+ Reply to Thread
Results 1 to 4 of 4

Dynamic Named Range - Moving

  1. #1
    Registered User
    Join Date
    08-19-2004
    Posts
    60

    Dynamic Named Range - Moving

    Hi

    I have a worksheet (as attached) which has eight lists of products.

    I want to create a dynamic named range which changes depending on which list of products is selected.

    eg.

    List1 List2 List3
    aaa bbb ddd
    ggg ttt ppp
    rrr xxx bbb
    ooo

    If the user selects "List1" from a separate dropdown box then the named range will become A1:A4, if "List2" it will become B1:B5, etc.

    Please take a look at the attached sheet as the formula i have used in the define name box does not work, i have even split the formula up into parts on the worksheet and each part calculates the desired result correctly, but not when put together for some reason.

    Thanks

    James
    Attached Files Attached Files

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    Using two named ranges would be one approach

    Name: myColumn
    RefersTo: =OFFSET(xxx!$A$1,0,MATCH(xxx!I28,xxx!$A$1:$H$1,0)-1,ROWS(xxx!$A:$A),1)

    Name: myDynamicRange
    RefersTo: =OFFSET(myColumn,0,0,COUNTA(myColumn),1)
    Last edited by mikerickson; 05-01-2008 at 03:41 AM.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    08-19-2004
    Posts
    60
    Hi,

    Thanks for repyling, however i can't get this to work, can you try it for me and attach it back?

    Thanks

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    When using relative refereneces in Names, it is imported to select the proper cell before defining the Name. In the attached, J28 was active when myColumn was defined, so myColumn (and myDynamicRange) is the column whose header matches the cell to the left of the formula.
    Attached Files Attached Files

+ 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