Private Sub create() createAnIndexPage End Sub ' create an index page Public Sub createAnIndexPage(Optional indexName As String = "indexSheet", _ Optional clearIndex As Boolean = False) Dim ws As Worksheet, w As Object, r As Range Set ws = sheetExists(indexName) If ws Is Nothing Then Set ws = Sheets.add ws.name = indexName ws.Cells(1, 1).Value = "Sheet" End If If clearIndex Then With wholeWs(ws) If .rows.count > 1 Then .Offset(1).ClearContents End If deleteAllFromCollection .Hyperlinks End With End If Set r = firstCell(ws.Cells) For Each w In Sheets If w.name <> ws.name Then If isSheet(w) Then Set r = r.Offset(1) ws.Hyperlinks.add r, "", SAd(w.Cells(1, 1)), , w.name End If End If Next w End Sub
bruce mcpherson is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Based on a work at http://www.mcpher.com. Permissions beyond the scope of this license may be available at code use guidelines