+ Reply to Thread
Results 1 to 11 of 11

Use of Evaluate to fill an array

  1. #1
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    584

    Use of Evaluate to fill an array

    I am fascinated by Evaluate but so far have had such extremely limited use it might as well be non-existent and most examples I have read easily confuse me, though some I have attempted to tuck away in my memory somewhere.

    From the posts I have read that keep flying over my head I believe that Evaluate must be able to take a table column and create an array out of it. In my case I want to take the column "Name" which is in the table ListObjects("tblDirectory") which, if need be known, resides on the worksheet Worksheet("Directory") and create an array out of the names in it using Evaluate.

    Yes, it can be done all day long using any dang loop, but I would really like to start to gain a useful knowledge of this Evaluate thing...

    Thank-you!

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,958

    Re: Use of Evaluate to fill an array

    You don't need to use an array, or a loop - you can address the ith element of a specific column directly:

    Please Login or Register  to view this content.

    See here for more on how to address listobjects (in worksheet functions and in VBA) using structured references

    http://peltiertech.com/structured-re...-excel-tables/
    Last edited by Bernie Deitrick; 04-19-2016 at 05:45 PM.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    584

    Re: Use of Evaluate to fill an array

    I am learning a lot of new things!

    I value that which you have shown me and I still wish to learn more on using Evaluate. Any ideas of a good starting point (in the meantime I will be reading the page you referenced)?

  4. #4
    Registered User
    Join Date
    12-07-2015
    Location
    Germany
    MS-Off Ver
    2007 2010 2013
    Posts
    58

    Re: Use of Evaluate to fill an array

    I think the very basic Idea of Evaluate in its simple form is that it allows you to do what you can do in a spreadsheet in VBA
    Typically this is shown as :
    _____[here what you would type in a Spreadsheet cell]
    Such as in this You Tube Video:
    https://www.youtube.com/watch?v=CdQJqT_9uf4

    _.......................................


    But that is a bit of an oversimplification. In a more Full explicit Form it Evaluates a String
    ____Evaluate(String to be evaluated)
    ____Evaluate(“______”)
    This more explicit form allows you to build up a String to be evaluated from both Spreadsheet things and VBA things

    You can probably do a Google search yourself, ( like site:ExcelForum.com Evaluate ) but here a few useful Links i found:
    http://www.ozgrid.com/forum/showthread.php?t=52372
    http://www.mrexcel.com/forum/excel-q...powerfull.html


    Often a “neat” usage is suggested to do away with a loop with a simple Evaluate “One Liner code”...
    https://usefulgyaan.wordpress.com/20...ions-evaluate/

    but although things like that “look pretty” it is not always found to be the better, or the quickest way...
    http://www.excelforum.com/showthread...t=#post4331102

    _....................................

    To get to use this more explicit version you need to be able to handle the use of the Quotes in VBA and Evaluate which can be very mind blowing!!

    http://www.mrexcel.com/forum/excel-q...lications.html
    http://www.mrexcel.com/forum/general...ml#post4468324
    http://www.excelfox.com/forum/f2/spe....html#post9517



    Jack
    Last edited by JackSheet_1; 04-20-2016 at 04:15 AM.

  5. #5
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,958

    Re: Use of Evaluate to fill an array

    In addition to the other posts, here is some example code - the important thing is that you don't need to use the array as an array, but if you do, it is a 2D array rather than a 1D array:

    Please Login or Register  to view this content.
    Last edited by Bernie Deitrick; 04-20-2016 at 10:13 AM.

  6. #6
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    584

    Re: Use of Evaluate to fill an array

    Thanks guys!

    I guess there is no "Idiot's Guide to Evaluate"...

    As is cited in some of those articles, some of which I have had the pleasure of scratching my head at, is the phrase stating that Evaluate has so many uses. That starts my head spinning right there. Then, as Jack states, the combination of sheet formula, vba and quotation marks just kind of causes a brain overload.

    Best course at this point is to sit down and start running examples, as I suspect that's how you folks worked it.

    I appreciate the help.

  7. #7
    Registered User
    Join Date
    12-07-2015
    Location
    Germany
    MS-Off Ver
    2007 2010 2013
    Posts
    58

    Re: Use of Evaluate to fill an array

    Quote Originally Posted by brucemc777 View Post
    .....as Jack states, the combination of sheet formula, vba and quotation marks just kind of causes a brain overload.....
    This has done my head in frequently and i seem to need to re -learn every time i do things with Evaluate, especially the quotes. The simplified "short hand" [ ] simplifies the expression, especially regarding the quotes... but you loose the flexibility..... for example:
    https://usefulgyaan.wordpress.com/20...x/#comment-575


    _.....................

    Quote Originally Posted by brucemc777 View Post
    ...... examples, as I suspect that's how you folks worked it.
    I appreciate the help.
    correct, practice practice and more practice...
    Thanks for the feedback, glad we could help..

    P.s. some other subtle differences I just remebered when using the "shorthand" [ ] to do Named Range and Range referrencing stuff
    http://www.mrexcel.com/forum/excel-q...l?#post4332606
    Last edited by JackSheet_1; 04-20-2016 at 10:12 AM.

  8. #8
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    584

    Re: Use of Evaluate to fill an array

    The portion by Mr. Sullivan as follows is finally sinking through my skull. I hope it is not in violation of a policy to "re-post" the following; I do so as it might help others as I found this one of, if not the, most complicated aspects of decoding what the heck was going on; it was a vital link that I had missed (and THANK-YOU!)-

    2 Red Quotes are needed to literal quote in the expression
    ="Year " & "2013" -> =""Year "" & ""2013""

    1 Blue quote is needed around each string part that isn't a variable
    "string1" & variable2 & "string3"
    where string1=""Year "" & ""
    variable2= 2013
    string3= ""

    Substituting values of string1, variable2 and string3 yields
    """Year "" & """ & sYear & """"

  9. #9
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Use of Evaluate to fill an array

    Quote Originally Posted by brucemc777 View Post
    The portion by Mr. Sullivan as follows is finally sinking through my skull. I hope it is not in violation of a policy to "re-post" the following; I do so as it might help others as I found this one of, if not the, most complicated aspects of decoding what the heck was going on; it was a vital link that I had missed (and THANK-YOU!)-
    Yes - Some Nicely summarised results in that Thread... But you will go crazy if you try to prove those results!!
    '_- Google first, like this _ site:ExcelForum.com Gamut
    Use Code Tags: Highlight code; click on the # icon above,
    Post screenshots COPYABLE to a Spredsheet; NOT IMAGES PLEASE
    http://www.excelforum.com/the-water-...ml#post4109080
    https://app.box.com/s/gjpa8mk8ko4vkwcke3ig2w8z2wkfvrtv
    http://excelmatters.com/excel-forums/ ( Scrolll down to bottom )

  10. #10
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    584

    Re: Use of Evaluate to fill an array

    ...and I was thinking that I was finally seeing a glimmer of light-
    Silly Rabbit... (Recalling the scene from Kill Bill)

  11. #11
    Registered User
    Join Date
    12-07-2015
    Location
    Germany
    MS-Off Ver
    2007 2010 2013
    Posts
    58

    Re: Use of Evaluate to fill an array

    Quote Originally Posted by brucemc777 View Post
    ......(and THANK-YOU!)-
    ...
    ...and I was thinking that I was finally seeing a glimmer of light-
    Silly Rabbit... (Recalling the scene from Kill Bill)
    Want to go insane, just remembered this one.... why not do it in German just to get really confused
    http://www.excelforum.com/non-englis...ml#post4221013
    http://www.excelforum.com/non-englis...mensetzen.html

    Quote Originally Posted by Doc.AElstein View Post
    Hi pin lui.......

    _ .. Und weiter , noch eine Version, damit man wirklisch verwirrt wurde, .......

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Question about using Evaluate with an array of formulas not an array formula
    By Mr_Bill in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-19-2014, 03:26 PM
  2. Evaluate an Array Formula
    By rodrigoxsm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-02-2014, 05:26 PM
  3. [SOLVED] Evaluate Named Range Array formula to VBA Array
    By cmore in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-07-2014, 09:06 PM
  4. sumproduct can't evaluate array
    By Ikkyo82 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2013, 10:17 AM
  5. [SOLVED] Evaluate() an array
    By blueiris8 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-29-2012, 08:01 PM
  6. [SOLVED] Using Evaluate() in an Array
    By blueiris8 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2012, 03:01 PM
  7. Evaluate one cell against an array
    By tatoon in forum Excel General
    Replies: 11
    Last Post: 10-29-2009, 05:38 PM

Tags for this Thread

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