Here is a quick sort based approach. The UDF can be used in the formula
=SortDelimitedString(F8&"-"&F9&"-"&F10, "-")
Function SortDelimitedString(delimitedString As String, Optional Delimiter = " ", Optional Descending As Boolean) As String
Dim Numerals As Variant, i As Long
Dim strLeft As String, strRight As String, Pivot As String
If delimitedString = vbNullString Then Exit Function
Numerals = Split(delimitedString, Delimiter)
Pivot = Numerals(0)
For i = 1 To UBound(Numerals)
If (Numerals(i) < Pivot) Xor Descending Then
strLeft = strLeft & Delimiter & Numerals(i)
ElseIf (Pivot < Numerals(i)) Xor Descending Then
strRight = strRight & Delimiter & Numerals(i)
End If
Next i
strLeft = Mid(strLeft, Len(Delimiter) + 1): strRight = Mid(strRight, Len(Delimiter) + 1)
SortDelimitedString = Pivot
If strLeft <> vbNullString Then
SortDelimitedString = SortDelimitedString(strLeft, Delimiter, Descending) & Delimiter & SortDelimitedString
End If
If strRight <> vbNullString Then
SortDelimitedString = SortDelimitedString & Delimiter & SortDelimitedString(strRight, Delimiter, Descending)
End If
End Function
Bookmarks