+ Reply to Thread
Results 1 to 9 of 9

Drop down list to select sheet name

  1. #1
    Registered User
    Join Date
    12-03-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    8

    Drop down list to select sheet name

    Good Morning!

    I am trying to add a drop down list to my macro to allow the user to select from a list of names to name a new sheet created.
    I have the current macro which allows them to enter a sheet name, but I have decided I would prefer to provide a list to choose from as some formulas on another tab are dependent on the sheet name. How do I adjust the below to provide a list vs input box?

    Please Login or Register  to view this content.

    Thanks in advance for any help you can provide!!!
    Last edited by FinProfessional; 12-06-2013 at 01:49 PM. Reason: code tags

  2. #2
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Drop down list to select sheet name

    Will the number of sheets and the sheet names be static or dynamic? Also, will you want the list to include all sheets, or just certain ones?

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Drop down list to select sheet name

    Please take the time to review our rules. There aren't many, and they are all important.

    Rule #3 requires CODE tags around VBA code. I have added them for you because you are a new member.

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Registered User
    Join Date
    12-03-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Drop down list to select sheet name

    Hi natefarm,

    Thanks for the response! The number of sheets and sheet names will be dynamic. Each time they receive the current input box they are adding a new sheet. I want the list to include a list of names they can select to name each new sheet. I do not want the user to manually enter the sheet name.

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Drop down list to select sheet name

    InputBox is a built-in function, but list boxes have to be created and built. I have attached an example where the user is prompted with a user form that includes a list box showing all worksheet. The user selects a sheet then clicks OK to go to that sheet, or Cancel to cancel. A Sub called Test shows the form.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    12-03-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Drop down list to select sheet name

    Thanks! The rules have been reviewed.

    I've also adjusted my original post as I realized was not 100% clear. I want them to choose from a list of names to name a new sheet (not select and existing sheet). Sorry about the confusion.
    Last edited by FinProfessional; 12-06-2013 at 01:50 PM.

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Drop down list to select sheet name

    I misread your initial post. My macro allows the user to select an existing sheet, not select a name to be applied to a new sheet.

    You still need a list box. How are you going to determine what the list should be?

  8. #8
    Registered User
    Join Date
    12-03-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Drop down list to select sheet name

    I have a defined list they will be able to choose from to name each sheet. I have defined the range "forecast version". Is there a way to use this defined range in the macro?

  9. #9
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Drop down list to select sheet name

    Somewhere in your worbook, enter the list of names in a range, and name it NameList. Then from the Developer tab, insert an ActiveX Combobox in the desired location, and in the Properties, enter "NameList" in the ListFillRange. Right-click the combo box and select View Code. Then in the ComboBox1_Change event that it creates, put the following:
    Please Login or Register  to view this content.
    There are other things you can do with it, but that should get you startede.

+ 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. Linking drop down list to select from another list ?
    By slaughtontdc in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-19-2013, 07:55 AM
  2. [SOLVED] Select from drop down list to show another drop down list in a different cel
    By ExcelRanger in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-22-2012, 04:27 PM
  3. How do I use one list drop down menu result to select another list?
    By steveinspain in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-02-2007, 02:59 PM
  4. Select:Drop down list
    By Not A Clue in forum Excel General
    Replies: 1
    Last Post: 11-11-2006, 08:21 PM
  5. Replies: 5
    Last Post: 10-27-2005, 01:55 PM

Tags for this Thread

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