Dim strA() As String
Dim strB() As String
Dim strTemp As String
Dim i, j, k As Integer
strA() = Split("7,2,9,3,5,4,2,6,3,9", ",")
' ReDim strB(LBound(strA()) To UBound(strA()))
For i = LBound(strA()) To UBound(strA())
' del the same
If strA(i) <> "" Then
For j = i + 1 To UBound(strA())
If strA(j) <> "" Then
If strA(i) = strA(j) Then
strA(j) = ""
k = k + 1
End If
End If
Next j
End If
Next i
For i = LBound(strA()) To UBound(strA()) - 1
' reorder
For j = LBound(strA()) To UBound(strA()) - 1
If Val(strA(j)) > Val(strA(j + 1)) Then
strTemp = strA(j + 1)
strA(j + 1) = strA(j)
strA(j) = strTemp
End If
Next j
Next i
strTemp = ""
For i = LBound(strA()) To UBound(strA())
If strA(i) <> "" Then
strTemp = strTemp & strA(i) & ","
End If
Next i
strTemp = Left(strTemp, Len(strTemp) - 1)
MsgBox strTemp