在Excel中创build工作表的超链接列表

我知道如何使用指定工作簿中的所有工作表的特定超链接来填充工作表,但是如何排除某些工作表被列出?

我已经列出了我所使用的VB。 我想排除某些工作表,如“testing结果”等

Sub GetHyperlinks() Dim ws As Worksheet Dim i As Integer i = 9 For Each ws In ThisWorkbook.Worksheets ActiveWorkbook.Sheets("overview").Hyperlinks.Add _ Anchor:=ActiveWorkbook.Sheets("overview").Cells(i, 1), _ Address:="", _ SubAddress:="'" & ws.NAme & "'!A1", _ TextToDisplay:=ws.NAme i = i + 1 Next ws End Sub 

 Sub GetHyperlinks() Dim arrExclude Dim ws As Worksheet Dim i As Integer 'Sheets to be excluded from linking arrExclude = Array("Test Results", "some other sheet", "overview") i = 9 For Each ws In ThisWorkbook.Worksheets 'test to see if not excluded If IsError(Application.Match(ws.Name, arrExclude, 0)) Then ActiveWorkbook.Sheets("overview").Hyperlinks.Add _ Anchor:=ActiveWorkbook.Sheets("overview").Cells(i, 1), _ Address:="", _ SubAddress:="'" & ws.Name & "'!A1", _ TextToDisplay:=ws.Name i = i + 1 End If 'include this sheet Next ws End Sub