+ Reply to Thread
Results 1 to 4 of 4

INDIRECT and named ranges

  1. #1
    Registered User
    Join Date
    12-30-2008
    Location
    WI
    MS-Off Ver
    Excel 2003
    Posts
    5

    INDIRECT and named ranges

    I have two cells that contain dropdown boxes. Cell A1 has a list of departments (HR, IT, Accounting, etc.) and Cell A2 uses the INDIRECT function to pull in a list of positions applicable to the selected department in A1 using named ranges.

    I know how to do dynamic ranges if I have each list of department positions in different columns, but my source sheet has hundreds of them in one column (for example a1:a50 might be HR department, with b1:b50 being 50 HR positions, then a51:a200 might be IT with b51:B200 being IT positions). Someone updating the chart might insert a row in the middle somewhere to add a new IT position.

    What I'm wondering is how to make my nested dropdown of positions expand to include any new additions on the source sheet without making someone redefine the named range. Is this possible? Thanks much!!

  2. #2
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Idea

    I would pivot that column mate then create your dynamic named range based on the data in that pivot.

    i'd also add a refresh all pivots in the workbook_open module and on the worksheet_activate module that way your book will always be up to date.

    hope that helps

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    HTH
    Mr MaGoo
    Magoo.Inc MMVII

    If i've helped please add to my Rep by Clicking on the Blue Scales in the top right hand corner of the post

  3. #3
    Registered User
    Join Date
    12-30-2008
    Location
    Vermont, USA
    MS-Off Ver
    Excel 2003
    Posts
    64
    I'm not sure if this will get you on your way or not, but you can create a dynamic range by the following method-- if your department name is in Col A and the positions are in Col B, make a list of all departments (assuming just a few, you can do this by hand) somewhere that you've got space (say, Col D), and in the column next to them, create a dynamic range for each department like this:

    ="B$"&MATCH(D1,A:A,0)&":B$"&MATCH(D1,A:A,0)+COUNTIF(A:A,D1)-1

    You can then refer to this range in an INDIRECT formula within a more complex formula. This will keep accurate ranges even if someone inserts a row in the middle somewhere. Note that this assumes your positions are sorted by department.
    Last edited by clownfish; 01-02-2009 at 01:21 PM.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    Anytime I insert a row inside a named range, the range expands itself in the definitions. This doesn't occur for you?
    _________________
    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!)

+ 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