How to ad the text in column B to column A

Ivn68

Board Regular
Joined
Aug 21, 2015
Messages
82
I have last name in column A and first name in columnB.
I need it to combine together in columnA

ColumnA. ColumnB
Steve. Smith

Will look like
Steve, Smith
In columnA

I need to do it using a vba loop
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Code:
Sub t()
Dim c As Range
 For Each c In Range("A2", Cells(Rows.Count, 1).End(xlUp))
  c = c.Offset(, 1).Value & " " & c.Value
 Next
Columns("B").ClearContents
End Sub
 
Upvote 0
Try this:
Code:
Sub Test()
'Modified 6/12/2018 8:45 PM  EDT
Application.ScreenUpdating = False
Dim i As Long
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For i = 2 To Lastrow
    Cells(i, 1).Value = Cells(i, 2).Value & ", " & Cells(i, 1).Value
Next
Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top