Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Flipping text | Excel Worksheet Functions | |||
Flipping a Spreadsheet | Excel Worksheet Functions | |||
flipping a spreadsheet | Excel Worksheet Functions | |||
Flipping a name | Excel Programming | |||
Flipping the order around? | Excel Discussion (Misc queries) |