Article ID: 113237
Article Last Modified on 10/10/2006
Sub ConcatColumns()
Do While ActiveCell <> "" 'Loops until the active cell is blank.
'The "&" must have a space on both sides or it will be
'treated as a variable type of long integer.
ActiveCell.Offset(0, 1).FormulaR1C1 = _
ActiveCell.Offset(0, -1) & " " & ActiveCell.Offset(0, 0)
ActiveCell.Offset(1, 0).Select
Loop
End Sub
NOTE: The statement ActiveCell.Offset(0, 1).FormulaR1C1 can be replaced
with the statement ActiveCell.Offset(0, 1).Formula. They can be used with
equal success if you are using text and numbers only (not formulas). The
R1C1 used at the end of the first statement refers to row one, column one
and is the form used in examples in Help.
163435 VBA: Programming Resources for Visual Basic for Applications
226118 OFF2000: Programming Resources for Visual Basic for Applications
Additional query words: 5.00c 8.00 97 XL97 XL7 XL5 operator ampersand XL
Keywords: kbdtacode kbhowto kbprogramming KB113237