I pull in usernames in the form of "Smith, John" into a string.
I would like to convert this string to be "John Smith" instead.
(Not just for the name "John Smith" obviously but for any name)
What's an easy way to do this?
Thanks!
I pull in usernames in the form of "Smith, John" into a string.
I would like to convert this string to be "John Smith" instead.
(Not just for the name "John Smith" obviously but for any name)
What's an easy way to do this?
Thanks!
You can select the column with the usernames and use Text to Columns (under the data tab or ALT+A+E). Select Comma Delimited. Then use a formula such as =TRIM(B1)&" "&A1 to remove the space from the first name, flip the order of the names, and concatenate them back together with a space.
Assuming Smith, John is in A1, then you can use this formula in B1:
=TRIM(RIGHT(A1,LEN(A1)-FIND(",",A1))&" "&LEFT(A1,FIND(",",A1)-1))
then copy down as required.
Hope this helps.
Pete
This is on a userform actually, so I was hoping for a VBA solution. I suppose I could involve a worksheet in the operation and pull the value from there but wasn't sure if there was an easier way.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks