combine columns

  • Thread starter Darrell_Sarrasin via OfficeKB.com
  • Start date
D

Darrell_Sarrasin via OfficeKB.com

I am creating reports from a precreated excel document. my boss wants me to
take two columns and combine them Example column A is last name and Column B
is first name. She wants it to read last, first name. if it was a small doc
would not be bad but we have 10000 entries in the form. please help.
 
T

tedmi

Assuming that data begins in row 2, enter this formula in cell C2:
=A2 & ", " & B2
and copy down for as many rows as there are entries in Cols A and B.
 
M

Mike H

hi,

First name in a1
Second name in b1
this in c1
=B1&" "&A1

Double click the fill handle and ut will fill down as far as column B is
populated.

Mike
 
G

Gary''s Student

In an un-used column enter:
=A1 & ", " & B1 and copy down

Then take the new column, copy it, and paste/special/values back onto column
A.
 
D

Don Guillett

Sub lastfirst()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
lastrow = Cells(Rows.Count, "a").End(xlUp).Row
For Each c In Range("a2:a" & lastrow)
c.Value = c & ", " & c.Offset(, 1)
Next c
Application.ScreenUpdating = False
Application.Calculation = xlCalculationAutomatic

End Sub
 
D

Darrell_Sarrasin via OfficeKB.com

can this be manipulated so the results show in column c and does not effect
the first name?

Don said:
Sub lastfirst()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
lastrow = Cells(Rows.Count, "a").End(xlUp).Row
For Each c In Range("a2:a" & lastrow)
c.Value = c & ", " & c.Offset(, 1)
Next c
Application.ScreenUpdating = False
Application.Calculation = xlCalculationAutomatic

End Sub
I am creating reports from a precreated excel document. my boss wants me
to
[quoted text clipped - 3 lines]
doc
would not be bad but we have 10000 entries in the form. please help.
 
D

Don Guillett

If I understand, you have last in col a, first in col b and you want both in
col c. You probably should have been able to figure this out yourself.
c.offset(,2) = c & ", " & c.Offset(, 1)

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
[email protected]
Darrell_Sarrasin via OfficeKB.com said:
can this be manipulated so the results show in column c and does not
effect
the first name?

Don said:
Sub lastfirst()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
lastrow = Cells(Rows.Count, "a").End(xlUp).Row
For Each c In Range("a2:a" & lastrow)
c.Value = c & ", " & c.Offset(, 1)
Next c
Application.ScreenUpdating = False
Application.Calculation = xlCalculationAutomatic

End Sub
I am creating reports from a precreated excel document. my boss wants me
to
[quoted text clipped - 3 lines]
doc
would not be bad but we have 10000 entries in the form. please help.
 
Top