VBA – Create a Hyperlink Menu of Worksheets


Create Hyperlink Index of All Worksheets in Workbook

Let’s take the Macro to List all Sheets in a Workbook one step further and create a hyperlinked menu for each sheet in a workbook. This is a great time saver for someone that has many sheets and is trying to make a menu of hyperlinks to each one manually.

To use the macro just replace the word Sheet1(it appears twice) in the code with the tab name where you would like the results. Make sure there isn’t any important information on the output tab because it clears the data their before writing to it. After the macro runs, a list of every sheet with a hyperlink to each sheet is created.

dynamic menu

Sub ListSheets()

Dim ws As Worksheet
Dim x As Integer

x = 1

Sheets("Sheet1").Range("A:A").Clear

For Each ws In Worksheets

   Sheets("Sheet1").Cells(x, 1).Select
   ActiveSheet.Hyperlinks.Add _
   Anchor:=Selection, Address:="", SubAddress:= _
   ws.Name & "!A1", TextToDisplay:=ws.Name
   x = x + 1

Next ws

End Sub