Thanks for any help you may provide.
You probably need to build a formula in the column next to the data and
manipulat the data within the formula. Then, when you have the formula
working you can do a Copy - Paste Special (Values) on top of the formula to
keep the results but remove the formula.
Do you have an example of your data and how you want it to look?
--
Greg Mansius [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.
"Wrenn" <goplayou...@yahoo.com> wrote in message
news:0dc101c36e49$2bd7b250$a501...@phx.gbl...
One way, as an example: Assume your numbers are separated by commas,
then select the cells you want to sort and run this:
Public Sub SortNumbersWithinCells()
Const DELIM As String = ","
Dim sIn As String
Dim sArr As Variant
Dim sOut As String
Dim temp As Double
Dim change As Boolean
Dim i As Integer
Dim cell As Range
For Each cell In Selection
sIn = cell.Text
sArr = Split(sIn, DELIM)
Do
change = False
For i = 0 To UBound(sArr) - 1
If sArr(i) > sArr(i + 1) Then
temp = sArr(i)
sArr(i) = sArr(i + 1)
sArr(i + 1) = temp
change = True
End If
Next i
Loop Until change = False
For i = 0 To UBound(sArr)
sOut = sOut & DELIM & sArr(i)
Next i
cell.Value = Mid(sOut, 2)
sOut = Empty
Next cell
End Sub
Change DELIM if you have a different separator
Note: if using XL97/98/01/v.X, Split() doesn't exist. You can roll
your own or use the routine found at
http://support.microsoft.com/default.aspx?scid=kb;en-us;188007
Note also: this routine has no error handling - so it assumes that
all your cells will be well-formed.
In article <0dc101c36e49$2bd7b250$a501...@phx.gbl>,