Deborah
Are the names delimited by comma? If so use the macro as is.
If separated by a space, make adjustments at marked points.
Sub SortCell()
Dim i As Long, j As Long
Dim swap1, swap2
Dim varr
varr = Split(ActiveCell, ",")
' varr = Split(Activecell, " ") if space delimited
' peform bubble sort
For i = 0 To UBound(varr) - 1
For j = i + 1 To UBound(varr)
varr(i) = Trim(varr(i))
varr(j) = Trim(varr(j))
If varr(i) > varr(j) Then
swap1 = varr(i)
swap2 = varr(j)
varr(j) = swap1
varr(i) = swap2
End If
Next j
Next i
ActiveCell.Value = Application.Trim( _
Join(varr, ", "))
'remove the comma from between the ", "
End Sub
Gord Dibben MS Excel MVP
On Tue, 10 Oct 2006 10:16:03 -0700, Deborah P. in Charlotte <Deborah P. in