Article ID: 199638
Article Last Modified on 9/12/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: You can replace the statement
ActiveCell.Offset(0, 1).FormulaR1C1with the statement:
ActiveCell.Offset(0, 1).FormulaThey 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.
176476 OFF: Office Assistant Not Answering Visual Basic Questions
163435 VBA: Programming Resources for Visual Basic for Applications
181058 OFF98: How to Run Sample Macro Code from Knowledge Base Articles
Additional query words: XL98 vba
Keywords: kbhowto kbnofix KB199638