使用超链接显示隐藏的单元格 [英] Show hidden cells with a hyperlink

查看:177
本文介绍了使用超链接显示隐藏的单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好

是否可以显示隐藏的单元格/行在Excel 2013中使用超链接。

Is it posible to show a hidden cell/row With a hyperlink in Excel 2013.

我只是想要在一个单元格中创建超链接,并通过单击它将显示下面的隐藏单元格。

I just want to make a hyperlink in one cell, and by clicking on it the hidden cell below will show.

推荐答案

你好Frank S。

Hi Frank S.

是的 - 很可能使用工作表的FollowHyperlink事件。以下是您可能会执行的操作的示例(此代码包含在您要链接的特定工作表中)。此代码使用Not()逻辑设置为切换。超链接是
a超链接到单元格tself(例如,如果你把超链接放在单元格C5上,那么超链接就是'本文档中的一个位置',预期的工作表和单元格地址C5)。

Yes - it's very possible using the FollowHyperlink event of a worksheet. Here's a sample of what you might do (This code is contained in the specific worksheet you want to link up). This code is setup as a toggle using the Not() logical. THe hyperlink is a hyperlink to the cell tself (e.g. if you put the hyperlink on cell C5, then the hyperlink is to 'a place in this document', the intended worksheet & the cell address C5).

Option Explicit

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
    Dim rngToUnhide As Excel.Range
    Set rngToUnhide = Target.Range.Offset(1, 0)
    
    ' This sets the toggle:
    rngToUnhide.EntireRow.Hidden = Not (rngToUnhide.EntireRow.Hidden)
End Sub


这篇关于使用超链接显示隐藏的单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆