Results 1 to 10 of 27

Thread: Concatenating your Balls

Threaded View

DocAElstein Concatenating your Balls 08-17-2014, 01:05 AM
Excel Fox DocAElstein... 08-21-2014, 12:01 AM
DocAElstein Hi, Thanks very much for... 08-21-2014, 12:51 AM
Excel Fox Here's another sample by... 08-21-2014, 01:48 AM
Excel Fox OK, here's another thread... 08-21-2014, 02:08 AM
Excel Fox By the way, you can reference... 08-21-2014, 02:12 AM
DocAElstein Wow, great, Thanks for all... 08-21-2014, 03:15 AM
DocAElstein Hi, VBA Evaluate Range... 09-20-2014, 03:31 AM
Excel Fox For those interested to hear... 08-21-2014, 12:03 AM
Excel Fox OK. The conditional... 08-21-2014, 01:20 AM
DocAElstein Thanks very much. I'll try... 08-21-2014, 01:42 AM
DocAElstein Hi „Fox“, . I am... 08-22-2014, 03:37 AM
DocAElstein Try the Table again 08-22-2014, 03:40 AM
DocAElstein Ok. I have not quite got... 08-22-2014, 03:46 AM
DocAElstein Today I tried your exact... 08-23-2014, 03:34 AM
DocAElstein So theEquivalent code would... 08-23-2014, 03:49 AM
DocAElstein ……………… Finally gettingback... 08-23-2014, 03:51 AM
DocAElstein …TO NEXT REPLYBECAUSE OF SIZE... 08-23-2014, 03:53 AM
DocAElstein . The final codeworks. Rick... 08-23-2014, 03:54 AM
DocAElstein Re: EvaluatingConcatenating... 08-23-2014, 03:47 AM
MARK858 Hi DocAElstein, just as a... 10-12-2014, 11:13 PM
DocAElstein Thanks. . Any idea how I... 10-13-2014, 01:07 AM
MARK858 You can't, the Forum Admin... 10-13-2014, 05:43 AM
DocAElstein OK., . I will look into... 10-13-2014, 02:07 PM
DocAElstein did not work see here: where... 09-20-2014, 03:36 AM
DocAElstein I apply this code Sub... 09-20-2014, 03:40 AM
DocAElstein and get this: see again:... 09-20-2014, 03:43 AM
Previous Post Previous Post   Next Post Next Post
  1. #12
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    9,522
    Rep Power
    10
    Quote Originally Posted by Excel Fox View Post
    OK. The conditional evaluation returns an array of values, whereas a direct non-conditional evaluation would return a single value 'in some cases'. There could be a valid theory behind that, but that is not something I am privy to. It's probably the way EVALUATE function works. So anyway, to understand that difference a bit more clearly, you can test the following to codes. Both are actually trying to do the same time, but since the evaluate function 'in some cases' only returns a single value in the second code, the entire output in A1:A10 becomes the same. Having said that, in this case below, both the codes seem to be working fine in some systems, and not in some other systems. I will get back to you with a suitable example.

    Code:
    Range("A1:A10") = Evaluate("IF(1," & Range("A1:z10").Columns(2).Address & "&"" - ""&" & Range("A1:z10").Columns(3).Address & "&"" - ""&" & Range("A1:z10").Columns(4).Address & ")")
    Code:
    Range("A1:A10") = Evaluate(Range("A1:z10").Columns(2).Address & "&"" - ""&" & Range("A1:z10").Columns(3).Address & "&"" - ""&" & Range("A1:z10").Columns(4).Address)
    And by the way, you don't neces.......................


    Hi „Fox“,
    . I am working through the code again from Rick that I did not understand, getting good clued up on the exact syntax in complex Evaluation codes (A Tricky one!!!), and working through all the info you sent. I am almost there and expect to post here soon what I think would be a useful reply to this Thread. I noticed something along the way, which I do not quite understand. I applied it to your codes, (or rather some very similar) and got similar results. So while I am finishing the main reply I thought I might just post that as something to be going on with in the meantime……

    . Firstly , just
    . a) for clarity in the thread response editor, and
    . b) so that it suits the example I am working with in regard to Rick’s code,
    . – I have slightly modified the exact ranges to suit this Table (where column H is the output column and the other yellow highlighted area is my input data.


    . Correspondingly your codes, modified by me, look like this:

    Code:
    Sub Fox1lmr()
    Range("H2:H10") = Evaluate("IF(1," & Range("A2:D10").Columns(2).Address & "&"" - ""&" & Range("A2:D10").Columns(3).Address & "&"" - ""&" & Range("A2:D10").Columns(4).Address & ")")
    End Sub
    Sub Fox2lmr()
    Range("H2:H10") = Evaluate(Range("A2:D10").Columns(2).Address & "&"" - ""&" & Range("A2:D10").Columns(3).Address & "&"" - ""&" & Range("A2:D10").Columns(4).Address)
    End Sub
    . Either of these codes gives the results shown in the table above.

    If I modify your codes to this

    Code:
    Sub Fox1lm()
    Range("H2:H10") = Evaluate("IF(1," & Range("A2:D10").Columns(2).Address & "&"" - ""&" & Range("A2:D10").Columns(3).Address & ")")
    End Sub
    Sub Fox2lm()
    Range("H2:H10") = Evaluate(Range("A2:D10").Columns(2).Address & "&"" - ""&" & Range("A2:D10").Columns(3).Address)
    End Sub
    . then as expected I only get the l and m values. But again both Codes work.

    If I modify the codes again to this

    Code:
    Sub Fox1l()
    Range("H2:H10") = Evaluate("IF(1," & Range("A2:D10").Columns(2).Address & ")")
    End Sub
    Sub Fox2l()
    Range("H2:H10") = Evaluate(Range("A2:D10").Columns(2).Address)
    End Sub
    . then I expect to get only the l values . BUT in fact after running both codes they both give me blank cells in column G.

    . However this code

    Code:
    Sub Fox1lRow()
    Range("H2:H10") = Evaluate("IF(ROW()," & Range("A2:D10").Columns(2).Address & ")")
    End Sub
    . Does give me the expected results.

    . I hope to explain in my final reply that Ricks code does not require the Row() as I had initially thought. With the above results along with some very careful Syntax considerations I hope to be able to prove and explain why that is. (In the second reference you gave me I think they may have slightly “glossed over” a full explanation of this by being careful exactly what ranges they were using as well as changing them to suit as they went along!!!)

    Alan

    P.s. As I did some test in your Tests just now in your test forum I hit on some space / size limitation which I have not experienced in MrExcel? Can I possibly have my space, or does that come automatically when I become a “Senior” member or whatever the next bit up is??
    Last edited by Admin; 10-14-2014 at 07:53 AM. Reason: removed HTML codes

Similar Threads

  1. Replies: 3
    Last Post: 02-24-2014, 05:48 AM
  2. Replies: 6
    Last Post: 07-26-2013, 11:42 AM
  3. Replies: 3
    Last Post: 05-23-2013, 11:17 PM
  4. Replies: 7
    Last Post: 05-09-2013, 11:16 PM
  5. Converge Data From Multiple Columns To Single Column
    By ayazgreat in forum Excel Help
    Replies: 3
    Last Post: 12-14-2012, 10:55 PM

Posting Permissions

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