![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Location: Dayton, Ohio
Posts: 3
|
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 |
|
Board Regular
Join Date: Feb 2002
Location: Victoria, Australia
Posts: 761
|
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 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
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 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|