excel 隐藏工作表和超链接问题

2025-04-03 21:38:46
推荐回答(1个)
回答1:

http://hi.baidu.com/gouweicao78/blog/item/88a1b8cc4f5101450eb3452d.html
有2种方案,一种是设置不显示工作表标签,也就无需隐藏工作表。
另一种是用VBA代码实现,代码如下(具体示例文件可在链接中下载):
Private Sub Worksheet_Activate()
Dim sht As Worksheet
For Each sht In Worksheets
If sht.Name <> "目录" Then sht.Visible = xlSheetVeryHidden
Next sht
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
Sheets(Target.Value).Visible = xlSheetVisible
Sheets(Target.Value).Select
End Sub