Results 1 to 10 of 603

Thread: Appendix-Thread-Evaluate-Range-(-Codes-for-other-Threads-HTML-Tables-etc-)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #35
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,316
    Rep Power
    10
    this is post #599
    https://www.excelfox.com/forum/showt...ll=1#post24132
    https://www.excelfox.com/forum/showthread.php/2909-Appendix-Thread-Evaluate-Range-(-Codes-for-other-Threads-HTML-Tables-etc-)?p=24132&viewfull=1#post24132
    https://www.excelfox.com/forum/showt...ge60#post24132
    https://www.excelfox.com/forum/showthread.php/2909-Appendix-Thread-Evaluate-Range-(-Codes-for-other-Threads-HTML-Tables-etc-)/page60#post24132




    Put Formulas in cells, with Evaluate(" ") , or use them in Evaluate Range type solutions if they are involved with new line characters

    The original issues that sparked off this page, can be dealt with, or rather can be almost forgotten and / or don’t occur, as we now have a much better in depth understanding of the required string constructions, so can go directly to them, armed with our new knowledge of what fundamentally the Evaluate(" ") is /does

    ' 2a Char(13)&Char(10)
    Char(13)&Char(10) is recognised Excel syntax. The characters of a and b are not
    VBA wants to see this string in order to put the formula into the cell
    "=""a""&Char(13)&Char(10)&""b"""
    So producing all those bits from Evaluate(" ") requires carefully producing each of those characters
    Code:
     """" & "=" & """" & """" & "a" & """" & """" & "&" & "Char(13)&Char(10)" & "&" & """" & """" & "b" & """" & """" & """"
    With the previous knowledge, it’s fairly straight forward. Here again in words what we have done: We consider the string that VBA wants to have , in its simplest form. ( It must be in the simplest form without any of the VBA " & " bits, since Evaluate(" ") in this use if it is only going to return to us a simple string, not a code line. By the same reasoning the Evaluate(" ") won’t give any other VBA things like variables and functions, so the " & " is not needed anyway.
    We then make the string for evaluate, strEval . We do this by consigöring each character in turn of the string we need in VBA,
    Code:
        "      =      "      "      a      "      "    &     Char(13)&Char(10)   &      "      "      b      "      "      "                                              ' For VBA
    , for each of the 16 things there, we know the equivalent to have inside Evaluate(" ")
    Each of those is then joined by a " & "
    Here is that working result again
    Code:
       """" & "=" & """" & """" & "a" & """" & """" & "&" & "Char(13)&Char(10)" & "&" & """" & """" & "b" & """" & """" & """"
    Last edited by DocAElstein; Today at 01:57 AM.

Similar Threads

  1. Testing Concatenating with styles
    By DocAElstein in forum Test Area
    Replies: 2
    Last Post: 12-20-2020, 02:49 AM
  2. testing
    By Jewano in forum Test Area
    Replies: 7
    Last Post: 12-05-2020, 03:31 AM
  3. Replies: 18
    Last Post: 03-17-2019, 06:10 PM
  4. Concatenating your Balls
    By DocAElstein in forum Excel Help
    Replies: 26
    Last Post: 10-13-2014, 02:07 PM
  5. Replies: 1
    Last Post: 12-04-2012, 08:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •