Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Concatenation of txt fields

  1. #1
    New Member
    Join Date
    Mar 2002
    Location
    Dayton, Ohio
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I need a simple VBA routine to concatenate two cells of information, such as last name in A1 cell with first name B1 cell. Then need it to perform a loop to continue through the two columns - doing the same thing to all of the data present. Any help would be appreciated.

  2. #2
    Board Regular RichardS's Avatar
    Join Date
    Feb 2002
    Location
    Victoria, Australia
    Posts
    761
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Do you need a VBA solution? Can't you just, in cell C1, put =A1&" "&B1, and copy down as far as you need?
    Richard

  3. #3
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Xarin

    As has been said you don't have to use a macro, but if you do I wouldn't use a Loop. Try this instead.It assumes your 2 columns to join are "A" & "B" and you want them joined in "C"

    Sub JoinIt()
    With Range("B2", Range("B65536").End(xlUp)).Offset(0, 1)
    .FormulaR1C1 = "=RC[-2] & "" "" &RC[-1]"
    Range("B2", Range("B65536").End(xlUp)).Offset(0, 1) = .Value
    End With

    _________________
    Kind Regards
    Dave Hawley
    OzGrid Business Applications
    Microsoft Excel/VBA Training
    If it's Excel, then it's us!

    [ This Message was edited by: Dave Hawley on 2002-03-05 21:50 ]

    [ This Message was edited by: Dave Hawley on 2002-03-05 21:52 ]

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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