Results 1 to 10 of 11

Thread: Concatenate Two Or Multiple Columns In To One

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10
    Another way

    Code:
    Sub PrepareJ()
    
        Dim lng As Long
        lng = Cells(Rows.Count, "B").End(xlUp).Row
        Range("J7:J" & lng).Value = Evaluate("=B7:B" & lng & "&E7:E" & lng)
        
    End Sub
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  2. #2
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    662
    Rep Power
    15
    Quote Originally Posted by Excel Fox View Post
    Another way

    Code:
    Sub PrepareJ()
    
        Dim lng As Long
        lng = Cells(Rows.Count, "B").End(xlUp).Row
        Range("J7:J" & lng).Value = Evaluate("=B7:B" & lng & "&E7:E" & lng)
        
    End Sub
    Just pointing out... while it does not hurt anything to leave it in, the equal sign at the beginning of the argument to the Evaluate function is not needed... Evaluate will run the same with or without it.
    Last edited by Rick Rothstein; 07-03-2013 at 10:27 AM.

  3. #3
    Member
    Join Date
    Jun 2013
    Posts
    52
    Rep Power
    13
    I also noticed that this code will calculate the whole workbook, can I make it only work on one sheet. even the automatic one would need the same setup if possible.

Similar Threads

  1. Replies: 7
    Last Post: 05-15-2013, 02:56 PM
  2. Loop to two columns and Concatenate values
    By ivandgreat in forum Excel Help
    Replies: 15
    Last Post: 04-14-2013, 08:20 PM
  3. Concatenate multiple values
    By mcpizzle in forum Excel Help
    Replies: 3
    Last Post: 08-30-2012, 04:03 PM
  4. Replies: 2
    Last Post: 06-14-2012, 04:10 AM
  5. Concatenate Multiple Lookup Values in Single Cell
    By Admin in forum Download Center
    Replies: 4
    Last Post: 04-06-2012, 09:07 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
  •