I found the following VBA Code online for creating an index of sheets and it works perfectly to create a single column (A2:A10, A1 showing "INDEX"), of Hyperlinked Sheets; however, as always, I would like to add some additional functionality. In each sheet, I have a value (Document Number in cell C3) that I would like to show up in the column next to the Hyperlinked Sheet (B2:B10, with B1 showing "Doc Number")
Any help would be greatly appreciated
VBA Code:
Private Sub Worksheet_Activate()
'Define variables
Dim ws As Worksheet
Dim row As Long
row = 1
'Clear the previous list and add "INDEX" title
With Me
.Columns(1).ClearContents
.Cells(1, 1) = "INDEX"
End With
'Loop through each sheet to add a corresponding hyperlink by using the name of the worksheet
For Each ws In Worksheets
If ws.Name <> Me.Name And ws.Visible = xlSheetVisible Then
row = row + 1
Me.Hyperlinks.Add Anchor:=Me.Cells(row, 1), _
Address:="", _
SubAddress:="'" & ws.Name & "'!A1", _
ScreenTip:="Click to go to sheet " & ws.Name, _
TextToDisplay:=ws.Name
End If
Next ws
'Adjust the width of first column by the longest worksheet name
Me.Columns(1).AutoFit
End Sub
Any help would be greatly appreciated