+ Reply to Thread
Results 1 to 19 of 19

Copy/paste all worksheet names into one sheet

  1. #1
    Registered User
    Join Date
    09-23-2010
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    23

    Copy/paste all worksheet names into one sheet

    Hi all,

    I'm having trouble figuring out how I would get all of the worksheet names in 1 workbook, copying and pasting them into cells in another sheet in that same workbook.

    Example:
    Sheet1 = Apple
    Sheet2 = Pear
    Sheet3 = Banana

    Code would make extra sheet at end called "List" and would have cell values:
    A1 = Apple
    A2 = Pear
    A3 = Banana

    Please help? Thank you!

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

    Re: Copy/paste all worksheet names into one sheet - Plz help!

    contra76,

    Welcome to the Excel Forum.


    The macro will create a new worksheet Results, and the other sheet names will be listed in column A.


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    Adding the Macro
    1. Copy the below macro, by highlighting the macro code and pressing the keys CTRL + C
    2. Open your workbook
    3. Press the keys ALT + F11 to open the Visual Basic Editor
    4. Press the keys ALT + I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Paste the code by pressing the keys CTRL + V
    7. Press the keys ALT + Q to exit the Editor, and return to Excel
    8. To run the macro from Excel, open the workbook, and press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.


    Please Login or Register  to view this content.

    Then run the "ListAllSheets" macro.
    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-23-2010
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Copy/paste all worksheet names into one sheet - Plz help!

    Thank you!! This works amazingly. Made my life a lot easier

  4. #4
    Registered User
    Join Date
    05-03-2012
    Location
    hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Copy/paste all worksheet names into one sheet

    Thanks for the same ...Its working very well

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

    Re: Copy/paste all worksheet names into one sheet

    lovecu,

    You are very welcome. Glad I could help.

    Come back anytime.

  6. #6
    Registered User
    Join Date
    08-02-2012
    Location
    San Francisco
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Copy/paste all worksheet names into one sheet

    Awesome! Thanks!

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

    Re: Copy/paste all worksheet names into one sheet

    skyfold,

    Welcome to the Excel Forum.

    Thanks for the feedback.

    Come back anytime.

  8. #8
    Registered User
    Join Date
    09-09-2012
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    0

    Re: Copy/paste all worksheet names into one sheet - Plz help!

    I also try this one. But I want similar with auto hyperlink function

  9. #9
    Registered User
    Join Date
    11-26-2012
    Location
    Saudi Arabia
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Copy/paste all worksheet names into one sheet

    really cool macro.

    thanks a lot Stanely.....

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

    Re: Copy/paste all worksheet names into one sheet

    adeel g,

    Thanks for the feedback.

    You are very welcome. Glad I could help.

    Come back anytime.

  11. #11
    Registered User
    Join Date
    11-26-2012
    Location
    Horjul, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Copy/paste all worksheet names into one sheet

    Works like a charm! I wanted the data to be imported in A column on a tab but I figured, I don't need this so often so I did it manually afterwards

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

    Re: Copy/paste all worksheet names into one sheet

    Gyanu,

    I also try this one. But I want similar with auto hyperlink function
    Sorry I missed your request - here you go.


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
    2. Open your workbook
    3. Press the keys ALT + F11 to open the Visual Basic Editor
    4. Press the keys ALT + I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
    7. Press the keys ALT + Q to exit the Editor, and return to Excel
    8. To run the macro from Excel, open the workbook, and press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.


    Please Login or Register  to view this content.

    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm


    Then run the ListAllWorksheetLinks macro.

  13. #13
    Registered User
    Join Date
    12-04-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    1

    Talking Re: Copy/paste all worksheet names into one sheet

    Awesome. Thank you SO much

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

    Re: Copy/paste all worksheet names into one sheet

    alobaidis,

    Thanks for the feedback.

    You are very welcome. Gald I could help.

    Come back anytime.

  15. #15
    Registered User
    Join Date
    02-15-2013
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Copy/paste all worksheet names into one sheet

    Hi, Stan. Thanks so much for making that idiot proof. Its really nice for you not to expect everyone who uses excel forum not to already be really good at macro writing. Some times people who do not use excel that much just need to get annoying problems sorted quick to hit a deadline. So I just wanted to say thanks for going the extra mile.



    Roger

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

    Re: Copy/paste all worksheet names into one sheet

    RogerWoo,

    Thanks for the feedback.

    You are very welcome. Glad I could help.

    Come back anytime.

  17. #17
    Registered User
    Join Date
    05-05-2012
    Location
    derby
    MS-Off Ver
    Excel 2011
    Posts
    1

    Re: Copy/paste all worksheet names into one sheet

    This is a fabulous solution - The issue i have is that some of the worksheet names have spaces in the name and in this instance, when i activate the link i get an error message "REFERENCE IS NOT VALID" - can this be overcome or do i need to change my naming structure?

    Thanks

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

    Re: Copy/paste all worksheet names into one sheet

    mcnamaram,

    Welcome to the Excel Forum.

    This is a fabulous solution
    Thank you very much.

    The issue i have is that some of the worksheet names have spaces in the name
    To get the most precise answer, it is best to upload/attach a sample workbook (sensitive data changed) that contains an example of your raw data on one worksheet, and on another worksheet your desired results.

    The structure and data types of the sample workbook must exactly duplicate the real workbook. Include a clear and explicit explanation of your requirements.

    To attach your workbook, scroll down and click on the Go Advanced button, then scroll down and click on the Manage Attachments button.

  19. #19
    Registered User
    Join Date
    03-10-2014
    Location
    New York, New York, USA
    MS-Off Ver
    Excel
    Posts
    1

    Re: Copy/paste all worksheet names into one sheet

    Quite Possibly One of the Most Helpful Threads on the Internet! THANKS!!!!

+ 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