This lists & hyperlinks, all Sheets then all Charts. What I would like is for the list to be in the order they are found in the workbook; i.e., sheet1, sheet2, chart1, sheet3, chart 2, etc. I have 126 tabs so a manual reorder isn't an option.
I'm sure there is a way to use an IF/OR but I have no idea how to do the THEN.
Sub CreateLinksToAll()
Dim sh As Worksheet
Dim ch As Chart
Application.ScreenUpdating = False
Sheets("Index").Select
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Range("A2").Select
For Each sh In ActiveWorkbook.Worksheets
If ActiveSheet.Name <> sh.Name And sh.Visible Then
ActiveCell.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"'" & sh.Name & "'" & "!A1", TextToDisplay:=sh.Name
ActiveCell.Offset(1, 0).Select
End If
Next sh
For Each ch In ActiveWorkbook.Charts
If ActiveSheet.Name <> ch.Name And ch.Visible Then
ActiveCell.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"'" & ch.Name & "'" & "!A1", TextToDisplay:=ch.Name
ActiveCell.Offset(1, 0).Select
End If
Next ch
Columns("A:A").Font.Size = 12
Range("A1").Select
End Sub