Results 1 to 11 of 11

Way to retrieve values from a dynamic named range?

Threaded View

  1. #1
    Registered User
    Join Date
    06-07-2011
    Location
    Cincinnati, OH
    MS-Off Ver
    Excel 2003
    Posts
    9

    Unhappy Way to retrieve values from a dynamic named range?

    Hoping someone on here knows the answer, it's probably something simple I'm overlooking.

    Currently we have a sheet with pre-defined values in columns such as:
    A
    1 MyValueA
    2 MyValueB
    3 MyValueC


    Which I refer to as a named set:
    MyNamedSet: =Lists!$A$2:$A$3

    And pull into an array in my VB code:
    MyArray = Evaluate(Names("MyNamedSet").RefersTo)

    Thus yielding the following array:
    MyArray (1,1) = MyValueA
    MyArray (1,2) = MyValueB
    MyArray (1,3) = MyValueC

    What I would like to do with this named set is make it to where it allows the user to add additional rows to the Lists worksheet which are then pulled into the array at macro runtime.

    To this end, I changed the Named item to be
    MyNamedSet: =OFFSET(Lists!$A$1,0,0,COUNTA(Lists!$A:$A),1)

    My hope was that this would automatically pull in the entire set of values from the "A" column, but instead it simple returns MyArray = "=OFFSET(Lists!$A$1,0,0,COUNTA(Lists!$A:$A),1)".

    Any ideas as to what I am doing wrong? I am trying to elimitate the need for the named range to be updated every time a new column value is added, am I going about things the correct way?
    Last edited by OLDWEASEL; 06-09-2011 at 11:51 AM.

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