View Single Post
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Private Sub Worksheet_Change(ByVal Target As Range)
Dim iPos As Long
On Error GoTo ws_exit:
Application.EnableEvents = False
With Target
If .Column = 1 Then
iPos = InStr(1, Target.Value, " ")
If iPos 0 Then
.Value = Right(.Value, Len(.Value) - iPos) & _
" " & Left(.Value, iPos - 1)
End If
End If
End With

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--

HTH

RP
(remove nothere from the email address if mailing direct)


"jtvich" wrote in message
...
I don't know if this can be done or not but I'm wanting to make a list of
names in one cell such as Josh Smith but instead of typing the last name
first like Smith Josh I would rather type Josh Smith and format the cell
somehow to display Smith Josh. Can this be done? Thanks in advance.