Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
sorting a column
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
sorting a column
Sorry the last function I Posted Changes names into to what you wnat to
convert them from... :-) Dopey Me... "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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
sorting a column
Use datatext to column to split or a helper column with the first name
only. Sub namesplit() For Each n In Selection n.Offset(, 1) = Right(n, Len(n) - InStr(n, ",")) Next End Sub -- Don Guillett SalesAid Software "Alex" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sorting a Pivot Table Column that is not the first column... | Excel Worksheet Functions | |||
sorting by one column | Excel Discussion (Misc queries) | |||
How do I limit sorting a column to the column? | Excel Worksheet Functions | |||
Right column doesn't change when sorting left column. | Excel Discussion (Misc queries) | |||
Sorting a column regardless of whether a value if + or - | Excel Programming |