1. 做成目录
Sub sbCatalog()
Dim i As Long
Dim ws As Worksheet
Dim strShtName As String
i = 2
Columns(1).ClearContents
Columns(2).ClearContents
For Each ws In Worksheets
If ws.Visible = xlSheetVisible Then
strShtName = ws.Name
If strShtName <> ActiveSheet.Name Then
'作成目录
i = i + 1
ActiveSheet.Cells(i, 1) = i - 2
ActiveSheet.Hyperlinks.Add anchor:=Cells(i, 2), Address:="", SubAddress:="'" & strShtName & "'!A1", TextToDisplay:="◆" & strShtName
'返回目录
If ws.Range("A1") = vbNullString Or ws.Range("A1") = "返回目录" Then
ws.Hyperlinks.Add anchor:=ws.Cells(1, 1), Address:="", SubAddress:="'" & ActiveSheet.Name & "'!A1", TextToDisplay:="返回目录"
ws.Range("A1").Font.Size = 16
ws.Range("A1").Font.Bold = True
End If
End If
End If
Next ws
End Sub