![]() |
Splitting first and family name
Hi
I have along list of names, like WENDY ROCHESTER which I want to change to ROCHESTER WINDY Can a kind sole tell me how? Thanks -- Norton Professional 2004 says this email is clean...believe it |
Splitting first and family name
|
Splitting first and family name
Assuming that the format is always going to be:
FirstName LastName 'In this example, range is A2:A100 Sub SwitchIt() Dim Cell As Range For Each Cell In Range("A2:A100") If Len(Cell.Value) < 0 Then Cell.Value = Mid(Cell.Value, Application.Find (" ", Cell.Value, 1) + 1, 100) & " " & Left(Cell.Value, Application.Find(" ", Cell.Value) - 1) End If Next Cell End Sub -----Original Message----- Hi I have along list of names, like WENDY ROCHESTER which I want to change to ROCHESTER WINDY Can a kind sole tell me how? Thanks -- Norton Professional 2004 says this email is clean...believe it . |
Splitting first and family name
Thanks very much...works great
"Tod" wrote in message ... Assuming that the format is always going to be: FirstName LastName 'In this example, range is A2:A100 Sub SwitchIt() Dim Cell As Range For Each Cell In Range("A2:A100") If Len(Cell.Value) < 0 Then Cell.Value = Mid(Cell.Value, Application.Find (" ", Cell.Value, 1) + 1, 100) & " " & Left(Cell.Value, Application.Find(" ", Cell.Value) - 1) End If Next Cell End Sub -----Original Message----- Hi I have along list of names, like WENDY ROCHESTER which I want to change to ROCHESTER WINDY Can a kind sole tell me how? Thanks -- Norton Professional 2004 says this email is clean...believe it . |
Splitting first and family name
Glad you go the answer you wanted, but if you are putting
the surname first why aren't you either placing a comma afterward the surname (like in the US) or making sure that the surname is capitalized, and the firstname is proper case as asked for on some international registration forms. --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "PCOR" wrote in message ogers.com... Thanks very much...works great "Tod" wrote in message ... Assuming that the format is always going to be: FirstName LastName 'In this example, range is A2:A100 Sub SwitchIt() Dim Cell As Range For Each Cell In Range("A2:A100") If Len(Cell.Value) < 0 Then Cell.Value = Mid(Cell.Value, Application.Find (" ", Cell.Value, 1) + 1, 100) & " " & Left(Cell.Value, Application.Find(" ", Cell.Value) - 1) End If Next Cell End Sub -----Original Message----- Hi I have along list of names, like WENDY ROCHESTER which I want to change to ROCHESTER WINDY Can a kind sole tell me how? Thanks -- Norton Professional 2004 says this email is clean...believe it . |
All times are GMT +1. The time now is 11:04 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com