自动过滤的 Excel 超链接

发布于 2024-10-08 03:53:58 字数 136 浏览 0 评论 0原文

无论如何,是否可以创建一个超链接,这样一旦从“Sheet1”单击,我将被重定向到“Sheet2”并根据超链接范围或值自动过滤我的数据。

或者我可以使用超链接转到另一个工作表中的特定范围,但隐藏不在该范围内的所有内容吗?

谢谢!

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 value.

Or could I use the hyperlink to go to a specific range in another sheet but HIDE everything not in that range?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

诗化ㄋ丶相逢 2024-10-15 03:53:58

要实现将宏附加到超链接:

将 Worksheet_FollowHyperlink 事件处理程序添加到工作表,

例如,如果对于单元格 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

在跟随超链接后执行此操作,MsgBox 代码应替换为自动筛选活动工作表的代码,这将是目标工作表,在本例中为 Sheet2。

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.

长发绾君心 2024-10-15 03:53:58

您可以使用宏,并将其附加到超链接

you can use a macro, and attach it to a hyperlink

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文