PDA

View Full Version : [SOLVED] Are multiple hyperlinks to run multiple macros within a single sheet possible?



kualjo
12-29-2015, 07:44 AM
I have a need to insert several hyperlinks into a worksheet, each that would run different macros. There is currently a single hyperlink running one macro, but I need at least one more. The code I have is...

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
frmWIP.Show
End Sub

...which runs my userform. I'm now building a second userform and need a second hyperlink to run it. I've tried referencing the hyperlink's cell, but then nothing happens at all.

I'm kind of stuck. How can I make this work?

SamT
12-29-2015, 10:15 AM
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)

Select Case Target.TextToDisplay
Case "Work In Progress": frmWIP.Show
Case "New Project": frmNewPrjct.Show
End Select
End Sub

kualjo
12-29-2015, 10:42 AM
That's what I was looking for, SamT! Thanks so much; I'm in business!