PDA

View Full Version : hyperlink to run macro not working



kualjo
12-28-2015, 10:55 AM
I have the following code in a worksheet (not a module).

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
If Target.Range.Address = "E11" Then
frmWIP.Show
End If
End Sub

I want to click the hyperlink in cell E11 of the worksheet and have it bring up userform frmWIP. When I click the hyperlink, nothing happens. The code is actually borrowed and edited for my worksheet, so I'm not sure what I'm missing or doing wrong.

kualjo
12-28-2015, 11:25 AM
POP. Took out the IF statement and it works fine. The next test, I think, is that I need to add a second hyperlink to a different userform. Will I then need the cell references?

kualjo
12-28-2015, 01:29 PM
A second hyperlink to open a different userform only opens the original userform. When changing the code to reference the hyperlinked cell, the initial problem returns, namely nothing happens. So now my question is, How can I add a second hyperlink to run a second macro?