Weird Request

  • Thread starter Thread starter Marshal
  • Start date Start date
M

Marshal

howdy -
In Excel 2000; I have a list of names. They are
currently "last name, first name". How can I have Excel
turn those names to "first name last name" without having
to retype it all.

Example:
Doe, John
Tese, Jane

want to have Excel automatically change that to:
John Doe
Jane Tese

Anyone know how to do this?
Thanks,
Marshal
 
Hi Marshal

Select the troublesome cells and run this little macro:

Sub LastFirst()
Dim Cel As Range
Dim F As String, L As String
Dim i As Long
For Each Cel In Selection
i = InStr(Cel.Value, ",")
If i > 0 Then
F = Trim$(Mid$(Cel.Value, i + 1))
L = Trim$(Left$(Cel.Value, i - 1))
Cel.Value = F & " " & L
End If
Next
End Sub

HTH. Best wishes Harald
Excel MVP

Followup to newsgroup only please.
 
Back
Top