开发者

Excel Hyperlinks that auto filter

开发者 https://www.devze.com 2023-01-31 04:09 出处:网络
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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号