+ Reply to Thread
Results 1 to 6 of 6

Converting a Named Range from a Formula to an Integer Array

  1. #1
    Registered User
    Join Date
    07-11-2005
    Posts
    49

    Converting a Named Range from a Formula to an Integer Array

    Hi guys,

    I currently have a named range that is a formula that produces a 300X40 array of integers. I would like to have this integer array be fixed after the initial formula generates the values, to improve speed.

    Please Login or Register  to view this content.
    I used the marco recorder to generate the above code which is a simple 3x3 array. And I also understand how to add or edit a named range formula using vb, but what I can't figure out is how to enter the values from the output of a formula as an integer array. Any ideas?

    Thank you.

  2. #2
    Registered User
    Join Date
    07-11-2005
    Posts
    49

    Re: Converting a Named Range from a Formula to an Integer Array

    . .

  3. #3
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Converting a Named Range from a Formula to an Integer Array

    You could construct a string like "={1,2,3;11,12,13,...,}" and set the RefersTo to that, but the string would exceed the limits for name definition. There are workarounds that you could use, but it would be easiest to have a (very) hidden DataSheet, transfer the fixed vaules to that range
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  4. #4
    Registered User
    Join Date
    07-11-2005
    Posts
    49

    Re: Converting a Named Range from a Formula to an Integer Array

    Thanks for the reply Mike. I am currently doing this just for fun I guess you could say. Would you mind explaining the work around you referred to?

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Converting a Named Range from a Formula to an Integer Array

    The workaround is to break the huge long string "={1, 2, 3; 11, 12, 13;...;1001, 1002, 1003}", whose length exceeds the limit for name definition, into smaller strings
    Sub1 RefersTo: ="{1, 2, 3; 11, 12, 13; 21, 22"
    Sub2 RefersTo: =";31, 32, 33; 41, 42, 43; 51, 5"
    Sub3 RefersTo: ="2, 53; 61,62, 63; "
    ...
    Sub20 RefersTo: ="991, 992, 993; 1001, 1002, 1003}"

    Then there will be a consolidating name

    Name: staticArrary RefersTo: =EVALUATE(sub1&sub2&sub3&...&sub20)

    This code would help.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    07-11-2005
    Posts
    49

    Re: Converting a Named Range from a Formula to an Integer Array

    Great Mike! Thank you very much.

+ 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