+ Reply to Thread
Results 1 to 9 of 9

Create list of selected worksheet names

  1. #1
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Create list of selected worksheet names

    Hi everyone,

    I have two workbooks, workbook1, and workbook2. Workbook1 has the macro.

    All I'm trying to do is have a macro so that the user will select any worksheets he/she wants in workbook2 and the names of those worksheets will be copied to workbook1, sheet1, range("P3").

    Not trying to copy all worksheet names, only the ones that the user selected.

    Any ideas?

    Thanks!!

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Create list of selected worksheet names

    Create a userform.

    All it needs have is one textbox, one listbox and one command button.

    put the name of workbook two in the Textbox

    the Listbox is loaded with all the sheet names in workbook two.

    Select one or more lines on the listbox

    Click on the command button.

    The Selected names are saved on workbook One.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Create list of selected worksheet names

    Hi mehmetcik,

    The 2nd workbook is random. A list box with pre-determined worksheet names would not work. Thanks for your suggestion though.

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Create list of selected worksheet names

    Try this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  5. #5
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,023

    Re: Create list of selected worksheet names

    You can try this: A Userform with a listbox.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Sintek; 04-24-2017 at 01:31 PM.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  6. #6
    Forum Contributor
    Join Date
    07-29-2013
    Location
    Oshawa
    MS-Off Ver
    Excel 2010
    Posts
    660

    Re: Create list of selected worksheet names

    Hi Alpha,

    Thank you. Your macro works great, however I needed the list worksheet names to go down the column starting from P3. Apologies if I wasn't clear enough.

  7. #7
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,023

    Re: Create list of selected worksheet names

    Workbook1 has the macro. All I'm trying to do is have a macro so that the user will select any worksheets he/she wants in workbook2 and the names of those worksheets will be copied to workbook1, sheet1, range("P3").
    Did I misunderstand...Are you not wanting to open Workbook2 then select worksheets whose worksheet names must be populated in P3, P4, P5 etc

  8. #8
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Create list of selected worksheet names

    I decided to use One LISTBOX, One COMBOBOX and one command button.

    The Combobox allows you to select any open workbook you want.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mehmetcik; 04-24-2017 at 02:54 PM. Reason: Corrected.

  9. #9
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Create list of selected worksheet names

    Quote Originally Posted by Groovicles View Post
    Hi Alpha,

    Thank you. Your macro works great, however I needed the list worksheet names to go down the column starting from P3. Apologies if I wasn't clear enough.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Create list of selected worksheet names
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-11-2017, 10:11 AM
  2. Create a list that sums values of selected names in a dynamic range
    By PAexcel in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-18-2014, 11:23 AM
  3. [SOLVED] Create a list in one worksheet of the other worksheets' names
    By Kelli in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 04:05 AM
  4. [SOLVED] Create a list in one worksheet of the other worksheets' names
    By Kelli in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  5. Create a list in one worksheet of the other worksheets' names
    By Kelli in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  6. Create a list in one worksheet of the other worksheets' names
    By Kelli in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  7. Create a list in one worksheet of the other worksheets' names
    By Kelli in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM

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