I have 2 sheets in my workbook. In the Sheet1, i have a hyperlink which points to Sheet2!Y1. Whenever I click that hyperlink in Sheet1, I want to run the vba code in the another module.
I have data in Sheet1 like below:
A,B,C,D
1,11,111,hyperlink1
2,22,222,hyperlink2
whenever I hit hyperlink1, it should go to Sheet2 and apply filer on the pointed column.
Below is the code I am using for the Worksheet:
Public Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
If Target.SubAddress = "Sheet2!B1" Then
MsgBox "Macro"
End If
End Sub
The above code is not executing when I am clicking the hyperlink in sheet1. I tried different things, still no luck. Can you help me here?