+ Reply to Thread
Results 1 to 3 of 3

Array used as a Data Validation List

  1. #1
    Forum Contributor
    Join Date
    07-11-2009
    Location
    NYC,USA
    MS-Off Ver
    Excel 2007
    Posts
    135

    Array used as a Data Validation List

    Is it possible to create an array that holds the names of all the visible worksheets in a workbook,
    then use this array as a Data Validation List for a range of cells?

    I know how to code a List box, to list all of the sheets,
    but I’d rather have the user pick and choose from a drop down list in each cell.

    After the user makes the selection, three other cells will be populated with data
    from named ranges on each sheet.

    I’ve include a workbook for illustration.

    Thanks.
    Attached Files Attached Files
    Last edited by max57; 03-07-2010 at 07:48 PM.

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

    Re: Array used as a Data Validation List

    Your sample sheet is unclear if you want the PLATE sheet to simply LIST all the Recipe pages automatically, or if you want a data validation list in those cells that, when dropped open, would only list the sheets with recipes.

    So I'm showing you both.

    First, the named range called SheetsListed is a dynamic formula watching all the values in column A of the new sheet I added call SheetsList. Your macro NewRecipePage now has a line added that will add the name of any new recipes to the list on that sheet. You can hide this new sheet if you wish, to keep things looking tidy.

    Next, I put a series of formulas in your PLATE sheet B4:B20. As it is now, any sheets listed on the SheetsListed column A will simply appear on the PLATE sheet as they are created.

    If that's not what you wanted, but rather you wanted a drop down in those cells from which you could CHOOSE a sheet name from the list, that is there as well. Simply delete the formulas I put in those cells and use the drop downs instead.

    Lastely, I put in formulas for columns C, D and E.
    Attached Files Attached Files
    _________________
    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!)

  3. #3
    Forum Contributor
    Join Date
    07-11-2009
    Location
    NYC,USA
    MS-Off Ver
    Excel 2007
    Posts
    135

    Re: Array used as a Data Validation List

    Much obliged JB.
    Just what I needed.

    Question:
    Theoretically, is it possible to use an array in this instance, keeping the list in memory, rather than physically listing the sheets to be picked up again for validation?
    I was unable to find any examples saying it was possible, or for that matter, using an array in any similar fashion?

    Thanks
    Mark

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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