ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing Cell Contents (https://www.excelbanter.com/excel-programming/421391-changing-cell-contents.html)

Orion Cochrane

Changing Cell Contents
 
I have an employee list with names (First Last) in one column. Is there a way
to get the last name to show up first and then the first name? TIA.
--
I am running on Office 2003, unless otherwise stated.

Gary''s Student

Changing Cell Contents
 
Assuming that the names are in a single cell searated by a single blank,
select the cells and run this macro:

Sub swapum()
For Each r In Selection
s = Split(r.Value, " ")
r.Value = s(1) & " " & s(0)
Next
End Sub

--
Gary''s Student - gsnu200820


"Orion Cochrane" wrote:

I have an employee list with names (First Last) in one column. Is there a way
to get the last name to show up first and then the first name? TIA.
--
I am running on Office 2003, unless otherwise stated.


JE McGimpsey

Changing Cell Contents
 
One way:

A1: First Last
B1: =TRIM(MID(A1,FIND(" ",A1)+1,255) & ", " & LEFT(A1,FIND(" ", A1)-1)

In article ,
Orion Cochrane wrote:

I have an employee list with names (First Last) in one column. Is there a way
to get the last name to show up first and then the first name? TIA.


Orion Cochrane

Changing Cell Contents
 
Tried the formula route, and it works awesome! Thanks. I can use this
elsewhere I bet.
--
I am running on Office 2003, unless otherwise stated.


"JE McGimpsey" wrote:

One way:

A1: First Last
B1: =TRIM(MID(A1,FIND(" ",A1)+1,255) & ", " & LEFT(A1,FIND(" ", A1)-1)

In article ,
Orion Cochrane wrote:

I have an employee list with names (First Last) in one column. Is there a way
to get the last name to show up first and then the first name? TIA.




All times are GMT +1. The time now is 12:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com