ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Concatenate 3 columns. (https://www.excelbanter.com/excel-programming/354184-concatenate-3-columns.html)

Jim15[_13_]

Concatenate 3 columns.
 

This is the routine I used to concatenate 2 columns. How would I
concatenate 3 adjacent columns?

Thanks,

Jim


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


--
Jim15
------------------------------------------------------------------------
Jim15's Profile: http://www.excelforum.com/member.php...o&userid=26300
View this thread: http://www.excelforum.com/showthread...hreadid=515856



All times are GMT +1. The time now is 07:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com