VBA: Macro to Create a Hyperlink Menu of Worksheets

September 6th, 2004 | Categories: VBA | Tags:
-->

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.

dynamicmenu

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
Can't get the tutorial to work for you? Need help with your code?
Get answers right away at our AE Excel Support Forums!
  1. Varun
    April 4th, 2011 at 11:53
    Reply | Quote | #1

    Very good Code!