+ Reply to Thread
Results 1 to 4 of 4

Excel 2007 : Dynamic Named Range issue with Data Validation

  1. #1
    Registered User
    Join Date
    07-14-2010
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003
    Posts
    2

    Question Dynamic Named Range issue with Data Validation

    Hi there!

    I'm trying to utilize dynamic named ranges for a dependant drop down menu and I can't get it to work.

    In a nutshell.......

    The main sheet contains 3 drop down menus adjacent to each other, which the 1st is independant and the other 2 are depdandant on its predecessor. Various other cells throughout this sheet autopopulate with values based on the selections of the drop down menus.

    The 1st drop down menu utilizes this range for data validation:
    =OFFSET('Species List'!$A$5,0,0,COUNTA('Species List'!$A:$A),1)
    This effectively retrieves the desired list, and this list adjusts according to new/removed entrys to the list. The list retrieved is a list of animal species, fyi.

    The 2nd drop down menu utilizes this range for data validation:
    =INDIRECT(B9)
    This causes the drop down menu to refer to the value in cell B9 (the 1st drop down menu) and use that as a reference to return the next desired list, which is a list of samples based on the specified Species in the first drop down menu. Both the name of the named ranges (that I want dynamic) and the selections from the B9 drop down menu are identical in terms of characters used.

    I have on another sheet, Species List, aside from the list used for the 1st drop down menu, an array of currently named ranges, where each column represents a species and below that header is a list of samples. SO, i'm trying to make these named ranges dynamic with this code:
    =OFFSET('Species List'!$C$5,0,0,COUNTA('Species List'!$C:$C),1)
    However, with this code utilized, I can't get the 2nd drop down menu to retrieve the dynamic lists.

    I know I could just say screw the dynamics and make the named ranges to include space for new entries but I'd really like to keep things as simple and aesthetic as they can be.
    I'll attach a copy of the excel file for those who would prefer a first hand look, fyi I have only attempted to adjust the named ranges for Moose and Elk to be dynamic, the rest I have left as normal named ranges as I can't get the dynamics to work.

    Any thoughts? Help is mucho appreciated!

    Ryan
    Attached Files Attached Files

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Dynamic Named Range issue with Data Validation

    In short.... INDIRECT can't evaluate a Named Range that is itself Dynamic - as yours is.

    There are a couple of workarounds ... one quick way is to use the old XLM Evaluate call via another Name, eg:

    Please Login or Register  to view this content.
    Then modify Sample DV Source to be _DVList2

    That said you might want to revisit your dynamic formula for Elk - to discount the non-blanks appearing between C1:C5 or alternatively use a RefersTo formula of:

    Please Login or Register  to view this content.
    Last edited by DonkeyOte; 07-29-2010 at 02:26 PM. Reason: incorrect sheet ref in _DVList2 - corrected

  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: Dynamic Named Range issue with Data Validation

    You can't INDIRECT() reference a dynamically self-adjusting range, at least I've given up trying after a couple of years at it.
    _________________
    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
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Dynamic Named Range issue with Data Validation

    @JB - the XLM Evaluate route works with Dynamic Names without issue but does warrant saving as .xlsm in 2007+

    The other possibility is to use CHOOSE but has obviously limited practicality.

+ 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