如何在excel中自动生成目录
发布网友
发布时间:2022-05-04 18:23
我来回答
共1个回答
热心网友
时间:2022-06-24 15:14
Private Sub 更新目录_Click()
Application.ScreenUpdating = False
Dim Sht As Worksheet
Dim r As Integer
[a2:b65536].ClearContents
For Each Sht In ThisWorkbook.Sheets
If Sht.Name <> Me.Name Then
r = [a65536].End(xlUp).Row
Range("A" & r + 1).Value = Sht.Name
Me.Hyperlinks.Add Range("A" & r + 1), "#" & Sht.Name & "!A1", ScreenTip:=Sht.Name
Range("B" & r + 1).Value = Sht.[a1].Value
End If
Next
Application.ScreenUpdating = True
End Sub