View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_3_] Jim Thomlinson[_3_] is offline
external usenet poster
 
Posts: 983
Default sorting a column

Give this function a try...

Public Function FormatName(ByVal InputName As String) As String
FormatName = Right(InputName, Len(InputName) - InStrRev(Trim(InputName),
" ")) & _
", " & Trim(Left(InputName, InStrRev(InputName, " ")))
End Function

"Alex" wrote:

I have a column with a last and a first names as follows

Employee Name
Thibodeau, Cheryl
Milan, Nick
Chian, Mary
Janzen, Eliane
....

I need to sort it by the first name, which is the second word after the coma.

How could I do this?

Thanks