Using a Macro to Hyperlink to another Excel Workbook.

J

jamie

I want to create a button (macro) that when pressed opens another
spreadsheet (hyperlink).

The problem is that when the two spreadsheets are placed on someones
computer, obviously the link changes! In other programs I can use
%sourceDRV%/spreadsheet2.xls as the link and that causes the program
(Autoplay media for example) to search the same drive & location that
the first spreadsheet is on.

Is there anything I can use in VB to do the same thing?

As always...Thanks in advance

Jamie
 
G

Gary''s Student

Follow the path:

Sub hyyper()
p1 = "file:///"
p2 = ThisWorkbook.Path
p3 = "\sea_shell.xls"
ActiveWorkbook.FollowHyperlink Address:=p1 & p2 & p3
End Sub

Have the button run this code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top