The can be only one hyperlink event sub in the sheet module, so...
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
If Target.Range.Address = "$B$5" Then
Application.Run "'WorkbookName.ext'!YourSubName", Arg1, Arg2
ElseIf Target.Range.Address = "$B$10" Then
Application.Run "'WorkbookName.ext'!OtherSubName", Arg1, Arg2
End If
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
"Jeff" <
[email protected]>
wrote in message
Thank You Jim
Works great.
However I need to have several hyperlinks
in different cells B5 and B10 but it didn't work?
I tried this...
and Using ByVal Target or ByVal Target2 didn't work either.
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
If Target.Range.Address = "$B$5" Then 'cell where the hyperlink is
Application.Run "'WorkbookName.ext'!YourSubName", Arg1, Arg2
End If
End Sub
Private Sub Worksheet_FollowHyperlink(ByVal Target2 As Hyperlink)
If Target.Range.Address = "$B$10" Then 'cell where the hyperlink is
Application.Run "'WorkbookName.ext'!YourSubName", Arg1, Arg2
End If
End Sub