Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Mar 2006
    Location
    Princeton, New Jersey, USA
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Sydney, Australia, New South Wales, Australia
    Posts
    251
    Thanks
    0
    Thanked 4 Times in 4 Posts

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

    <pre>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
    </pre>


  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

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

    To add hyperlinks, change the line that adds the name in your or Peter's code to
    <code>
    ActiveSheet.Hyperlinks.Add Anchor:=Range("A" & 10 + i), _
    Address:="", _
    SubAddress:="'" & Sheets(i).Name & "'!A1", _
    TextToDisplay:=Sheets(i).Name</code>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •