Hyperlink 4 Opening More Than 1 File.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi friends,

Any idea how to write up a Hyperlink in excel, which, when clicked, opens up
two files?

All help is appreciated!

Thanx!
 
Using VBA, the hyperlink jump can be intercepted by a macro and the macro can
open any number of hyperlinks.
 
Thanx brother,

Can you give me a sample code, for example Cell(A1), when clicked, opens
C:\A.xls and C:\B.xls

By the way can one use the Hyperlink() function for two?
 
In cell A1 insert a hyperlink that jumps to cell A1. Clicking this will not
take us to anywhere new, just back to A1. It will however trip the
FollowHyperlink event. In the worksheet code area insert the following macro:

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
' gsnuxx
Set r = ActiveCell
If r.Address <> "$A$1" Then Exit Sub
Dim s As String
Application.EnableEvents = False
s = "file:///C:\A.xls"
ActiveWorkbook.FollowHyperlink (s)
s = "file:///C:\B.xls"
ActiveWorkbook.FollowHyperlink (s)
Application.EnableEvents = True
End Sub

The macro first makes sure we are at cell A1. It then does hyperlinks to
A.xls and B.xls
 
Back
Top