LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Flipping a name

Sub Selection_Loop()
Dim rngSelection As Range
Set rngSelection = Selection
Dim varCell As Variant

Dim intSpacePosition As Integer
Dim strFirstName As String
Dim strLastName As String

For Each varCell In rngSelection.Cells

With varCell
intSpacePosition = InStr(.Value, " ")
strFirstName = Left(.Value, intSpacePosition - 1)
strLastName = Mid(.Value, intSpacePosition + 1)

.Value = strLastName & ", " & strFirstName
End With

Next
End Sub
HTH
--
Trent Argante
[DC.J(<#)]


"Duncan_J" wrote:

If I got column of names
John Doe

And what to change it to
Doe, John

Is thier a way of doing this?

DJ

 
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
Flipping text Charlene Excel Worksheet Functions 4 November 15th 07 04:49 PM
Flipping a Spreadsheet Joy Excel Worksheet Functions 1 July 18th 07 02:16 PM
flipping a spreadsheet remarque Excel Worksheet Functions 2 October 27th 06 01:55 PM
Flipping a name Jim Thomlinson[_3_] Excel Programming 0 May 18th 05 05:43 PM
Flipping the order around? thrava Excel Discussion (Misc queries) 4 January 14th 05 01:23 PM


All times are GMT +1. The time now is 11:49 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"