Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default 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.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Length of Cell Contents taylord1936 Excel Discussion (Misc queries) 6 August 20th 08 12:41 AM
Changing Contents of a cell. Adam Excel Programming 4 February 21st 08 04:37 PM
Changing cell contents Mike Excel Discussion (Misc queries) 2 February 11th 08 04:41 PM
Changing Cell Contents Colour Spiller Excel Discussion (Misc queries) 3 November 24th 06 01:40 PM
Changing the Contents of a Cell PaulW Excel Discussion (Misc queries) 0 March 30th 06 10:40 AM


All times are GMT +1. The time now is 10:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"