Is there anyway to make a hyperlink such that once clicked from "Sheet1" I will be redirected to "Sheet2" and automatically filtered my data based on the hyperlink range or开发者_如何学JAVA value.
Or could I use the hyperlink to go to a specific range in another sheet but HIDE everything not in that range?
Thanks!
To implement attaching a macro to a hyperlink:
Add a Worksheet_FollowHyperlink event handler to the Worksheet,
eg if for a hyperlink on cell E4
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
If Target.Range.Address = "$E$4" Then
MsgBox "You can run some code if this hyperlink to " & _
Target.SubAddress & " in " & Target.Range.Address & " is clicked"
End If
End Sub
This executes after the hyperlink is followed, the MsgBox code should be replaced with code to AutoFilter the active sheet, which will be the target sheet, Sheet2 in this case.
you can use a macro, and attach it to a hyperlink
精彩评论