You are here:

Excel/Automatically Open Hyperlink


QUESTION: I want to purchase a barcode scanner which can import a specific data(part number)from datas stored in bar code(item number,vendir code, GR number etc.)into a specific cell of Microsoft Excel 2007.

Then I want Excel to automatically open the hyperlinked attach to that number. In excel I have reached to a stage where excel is giving me link of the hyperlink as soon as I paste the item number in that cell. But I have to double click on the hyperlink manually to make it open . What I actually want is as soon as I scan data attached hyperlink gets opened

ANSWER: You would use a Worksheet_change event to watch for changes in your scanner cell.
Then your Hyperlink formula will update based on that code, correct?

The next step you will develop in your Worksheet_Change code is to do a FollowHyperlink method on the cell with the hyperlink formula.

---------- FOLLOW-UP ----------

Thankyou very much for fast reply.Sir I am rephrasing my question so that ypu understand it more correctly. Although what answer you gave me I understood and thats what I want.

But as I am new to excel I am not able to run followhyperlink method.Please help me by giving step by step procedure of how to display hyperlinked that is located in cell D6 of Sheet 2 of excel named test
I have a master file where in all pdfs are hyperlinked to a particular part number..
For e.g.

Part Number   PDF   
123          123.pdf   
234          234.pdf   
345          345.pdf   
456          456.pdf   
567          567.pdf   

         and so on...

Now in a different sheet I have used a formula =hyperlink(Vlookup(C6,Sheet1!B1:C3,2,0)) in D6 wherein it is showing me the pdf that I attached in master file while I scan the bar code and importing relevant data into C6 cell of excel

For e.g.

         C          D
6   100***90(Inputting using bar code scanner)          100***90.pdf( this hyperlinked gets          ____          displayed when part number is scanned)

But pdf gets displayed only when I click on to the hyperlink.Is there a way that pdf gets displayed as soon as I enter the part number.

Also, I will input the data in a same cell every time and as soon as i scam pdf gets displayed with no clicking of mouse or buttons .So can I use worksheet_change event.Please elaborate with step by step detail..please.please.please.

Please help on this matter. Thank you in advance.

Saurabh Mundeja

1) 123.pdf is not a full address to a file, it's the name of a file.  If you want clickable hyperlinks I'm assuming your lookup table actually has the full path to the files in question.

2) So, assuming you want to follow the hyperlink in cell D6 anytime cell C6 changes, something like this in the sheet module:

Private Sub Worksheet_Change(ByVal Target As Range)

    If Not Intersect(Target, Range("C6")) Is Nothing Then
        Range("D6").Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
    End If

End Sub

About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts


Jerry Beaucaire


Excel Formulas, macros, automation. Microsoft Excel MVP - 2010. Code site with free code snippets and techniques:


Microsoft Excel MVP - 2010. I have my own extensive Excel help/code site: ===================== I have been offering free assistance as an Excel aid on many web sites for many years: ( - JBeaucaire) ======== ( - JBeaucaire) ======= ( - jbeaucaire)

Bachelor's Degree from Azusa Pacific University in Mathematics and Music Composition

Awards and Honors
Microsoft Excel MVP 2010

©2016 All rights reserved.