+ Reply to Thread
Results 1 to 4 of 4

Return Worksheet Name in Cell

  1. #1
    Registered User
    Join Date
    10-09-2009
    Location
    Cambridge, MA
    MS-Off Ver
    Excel 2003
    Posts
    61

    Return Worksheet Name in Cell

    Hello,

    I would like a list of all of the worksheets in my workbook. Is there an easy way to say:

    A1=worksheet name
    A2=worksheet+1 name
    A3=worksheet+2 name

    So that I can easily get a list of all of the worksheets in my workbook? Or not?

    thanks.
    Last edited by nofzinger; 05-10-2010 at 05:15 PM.

  2. #2
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Return Worksheet Name in Cell

    Install this function

    Please Login or Register  to view this content.
    How to use:
    1. Copy above code.
    2. In Excel press Alt + F11 to enter the VBE.
    3. Press Ctrl + R to show the Project Explorer.
    4. Choose Insert -> Module.
    5. Paste code into the right pane.
    6. Press Alt + Q to close the VBE.
    7. Save workbook before any other changes.

    Then in A1
    =WorksheetNames(B1)
    Copy Down
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Return Worksheet Name in Cell

    I like the function idea, but I would use this approach:
    Please Login or Register  to view this content.
    Used as:

    =WSNAME(1)
    =WSNAME(2)

    ...etc
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    10-09-2009
    Location
    Cambridge, MA
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: Return Worksheet Name in Cell

    Great! 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