Changing Cell Contents

  • Thread starter Thread starter Orion Cochrane
  • Start date Start date
O

Orion Cochrane

I have an employee list with names (First Last) in one column. Is there a way
to get the last name to show up first and then the first name? TIA.
 
Assuming that the names are in a single cell searated by a single blank,
select the cells and run this macro:

Sub swapum()
For Each r In Selection
s = Split(r.Value, " ")
r.Value = s(1) & " " & s(0)
Next
End Sub
 
One way:

A1: First Last
B1: =TRIM(MID(A1,FIND(" ",A1)+1,255) & ", " & LEFT(A1,FIND(" ", A1)-1)
 
Tried the formula route, and it works awesome! Thanks. I can use this
elsewhere I bet.
 
Back
Top