• Creating a hyperlink list of sheets (Excel 2000 or 2003)

    Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Creating a hyperlink list of sheets (Excel 2000 or 2003)

    Author
    Topic
    #431136

    Hi All …

    I can create a list (thanks to a post here) of all the sheets in the workbook.

    Sub ListSheets()
    Dim i As Long
    Dim n As Long
    n = ActiveWorkbook.Sheets.Count

    Sheets(“Navigation”).Select
    For i = 1 To n
    Range(“A” & 10 + i) = ActiveWorkbook.Sheets(i).Name
    Next i
    Range(“A” & 10 & “:A” & 10 + n).Sort Key1:=Range(“A10”)
    End Sub

    Unfortunately, this also lists my “hidden” sheets, which I do not want. And, because I like to “baby” my users, what I’d really like to do is to make the entries in the list hyperlinks to the sheet itself. The sheets are created dynamically in the macro …

    Any hints/help, as always, is greatly appreciated.
    –cat

    Viewing 1 reply thread
    Author
    Replies
    • #1008479
      Sub ListSheets()
          Dim i As Long
          Dim n As Long
          n = ActiveWorkbook.Sheets.Count
          
          Sheets("Navigation").Select
          For i = 1 To n
              
              If ActiveWorkbook.Sheets(i).Visible Then
                  Range("A" & 10 + i) = ActiveWorkbook.Sheets(i).Name
              End If
          Next i
          Range("A" & 10 & ":A" & 10 + n).Sort Key1:=Range("A10")
          
      End Sub
      
    • #1008503

      To add hyperlinks, change the line that adds the name in your or Peter’s code to

      ActiveSheet.Hyperlinks.Add Anchor:=Range("A" & 10 + i), _
      Address:="", _
      SubAddress:="'" & Sheets(i).Name & "'!A1", _
      TextToDisplay:=Sheets(i).Name

    Viewing 1 reply thread
    Reply To: Creating a hyperlink list of sheets (Excel 2000 or 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: