Tested in Excel 365 (16.8730.2046) 64-bit
Useful if you want to create a Home or Content tab.
- Public Sub CreateSheetNameLinks()
- '===================================================================================
- ' Created by: Sanda Vladescu
- ' Updated on:
- ' Purpose: create a table of contents with hyperlink to each sheet
- ' References:
- ' Usage example:
- '
- '===================================================================================
- Dim i As Integer
- If SheetExists("Summary") Then Sheets("Summary").Delete
- Sheets.Add before:=Sheets(1)
- ActiveSheet.Name = "Summary"
- Sheets("Summary").Select
- For i = 2 To Sheets.Count
- Range("B" & i).Select
- ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
- Sheets(i).Name & "!A1", TextToDisplay:= _
- Sheets(i).Name
- Next i
- End Sub
SheetExists function is here.