一键链接生成目录

2017-09-27  本文已影响0人  心的知觉

Sub ml()

Dim sht As Worksheet, i&, Shtname$

Sheets.Add.Name = "目录汇总表"

Cells(1, 1) = "目录"

i = 1

For Each sht In Worksheets

Shtname = sht.Name

If Shtname <> ActiveSheet.Name Then

i = i + 1

ActiveSheet.Hyperlinks.Add _

anchor:=Cells(i, 1), Address:="", SubAddress:="" & Shtname & "!a1", TextToDisplay:=Shtname

End If

Next

End Sub

上一篇下一篇

猜你喜欢

热点阅读