+ Reply to Thread
Results 1 to 10 of 10

Using a formula (=OFFSET) in a named array?

  1. #1
    Registered User
    Join Date
    06-06-2012
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    23

    Using a formula (=OFFSET) in a named array?

    Hey,

    So I have a loop that finds a worksheet, cat, and then names an array, cat, that is supposed to have the following value.

    Please Login or Register  to view this content.
    I know that code works when you input it directly into the name manager, but I'm having trouble creating the loop that will create the array with cat being a variable. This is what I have tried:

    Please Login or Register  to view this content.
    Suggestions?

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,974

    Re: Using a formula (=OFFSET) in a named array?

    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    06-06-2012
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Using a formula (=OFFSET) in a named array?

    Sort of... that doesn't really solve my original problem since it just sets the value of the array to be cat!.... which refers to a sheet named cat and not the variable cat.

    Any suggestions?

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,974

    Re: Using a formula (=OFFSET) in a named array?

    Oh, I think I see what you mean:
    Please Login or Register  to view this content.
    ? Assumes your sheet names are valid range names.

  5. #5
    Registered User
    Join Date
    06-06-2012
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Using a formula (=OFFSET) in a named array?

    That works perfectly, but for some reason its screwing with my dependant dropdown

    I have 1 dropdown with the value cat and then a second list that is supposed to be the dropdown cat, via =Indirect(a7), but whenever it tries to call the array that I've made nothing comes up?

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,974

    Re: Using a formula (=OFFSET) in a named array?

    INDIRECT does not work with dynamic named ranges. You'll need to create another named range that uses EVALUATE
    =EVALUATE(Sheetname!$A$7)
    and refer to that range name in the DV list.

  7. #7
    Registered User
    Join Date
    06-06-2012
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Using a formula (=OFFSET) in a named array?

    So the cell I'm using as the second dropdown is in worksheet Main, cell B7, and when I tried to change the source of B7 from =INDIRECT(A7) to =EVALUATE(Main!$A$7) it gives me a formula error message

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,974

    Re: Using a formula (=OFFSET) in a named array?

    You cannot use EVALUATE directly in a formula, which is why I said you had to create another defined name that uses that function, then refer to the name in the list. So for example define a name as MyList and in the RefersTo box enter:
    =EVALUATE(Main!$A$7)
    then in your DV list use =MyList as the source.

  9. #9
    Registered User
    Join Date
    06-06-2012
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Using a formula (=OFFSET) in a named array?

    Worked perfectly. Really appreciate the help romperstomper

    +rep

  10. #10
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,974

    Re: Using a formula (=OFFSET) in a named array?

    Glad to help.

+ 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