+ Reply to Thread
Results 1 to 10 of 10

Sheet names

Hybrid View

  1. #1
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: Sheet names

    Quote Originally Posted by chipgiii View Post
    ...VBA is still a struggle for me after a month and a half....
    Lol!
    Only a month & a half - if you get the bug, you could have years ahead of you. Not necessarily of "struggle" but definitely full of challenges. I've got a few years under my belt & I'm still learning

    Here's a small addition to Stanley's code to include hyperlinks:
    Option Explicit
    
    Sub ListAllSheets()
    Dim i As Long
    Dim ShtName As String
        For i = 1 To Sheets.Count
            ShtName = Sheets(i).Name
            With ActiveSheet
                .Cells(i, "A").Value = ShtName
                'or to add a link...
                .Hyperlinks.Add Anchor:=.Cells(i, "b"), Address:="", _
                                SubAddress:=ShtName & "!A1", TextToDisplay:=ShtName
            End With
        Next i
    End Sub
    I got the hyperlink line of code by recording a macro of my actions when I manually created a hyperlink using [ctrl + K], and then I modified the recorded code to use the ShtName variable.

    Stanley,
    Nice list of links

    hth
    Rob
    Last edited by broro183; 09-21-2010 at 04:20 PM. Reason: typo & praise
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Sheet names

    Rob,

    Thanks.

    The list just keeps getting longer and longer.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Registered User
    Join Date
    09-30-2013
    Location
    NJ, USA
    MS-Off Ver
    2010
    Posts
    3

    Re: Sheet names

    This is very helpful, thank you.

    I am new to VBA as well and having difficulty trying to modify this code to:
    1 - Start the list wherever the cursor is located
    2 - List the sheet names as hyperlinks only

    Thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1