隐藏代码:
Private Sub Worksheet_Activate()
Dim sht As Worksheet
For Each sht In Worksheets
If sht.Name <> Sheets(1).Name Then sht.Visible = xlSheetVeryHidden
Next sht End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next Dim shtname As String shtname = Target.Hyperlinks(1).SubAddress shtname = Mid(shtname, 1, InStr(shtname, "!") - 1) shtname = Replace(shtname, "'", "") Sheets(shtname).Visible = xlSheetVisible Sheets(shtname).Select End Sub
显示代码: Sub ShowAllMySheets()
MsgBox "使当前工作簿中的所有工作表都显示(即将隐藏的工作表也显示)" Dim ws As Worksheet For Each ws In Sheets ws.Visible = True Next ws End Sub |
|