Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Showing alternates
Sub splitnames() c = ActiveCell findcomma = InStr(c, ",") fand = InStr(c, "and") x = Mid(c, findcomma + 1, fand - findcomma - 2) & " " & Left(c, findcomma - 1) ActiveCell.Offset(, 1) = x ActiveCell.Offset(, 2) = Right(c, Len(c) - fand - 2) & " " & Left(c, findcomma - 1) End Sub 'more than one Sub splitnamesloop() For Each c In Range("a2:a16") findcomma = InStr(c, ",") fand = InStr(c, "and") 'each line below is ONE line c.Offset(, 1) = Mid(c, findcomma + 1, fand - findcomma - 2) & " " & Left(c, findcomma - 1) c.Offset(, 2) = Right(c, Len(c) - fand - 2) & " " & Left(c, findcomma - 1) Next End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "CCarter" wrote in message ... Is there a way for me to change: Smith, John and Jane to: John Smith Jane Smith Thanks in advance, Cathy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
split 1 column to 3 columns | Excel Discussion (Misc queries) | |||
how do i split names in to two columns | Excel Discussion (Misc queries) | |||
How do I split a cell into multiple rows/columns? | Excel Discussion (Misc queries) | |||
split column into 4 columns | Excel Discussion (Misc queries) | |||
Can Columns be split? | Excel Discussion (Misc queries) |