Option Explicit
Sub abc()
Dim a, i, j, p
a = Range("a1:c" & [a1].End(xlDown).Row + 1).Value
For i = 1 To UBound(a) - 1
For j = Len(a(i, 1)) To 1 Step -1
If Not IsNumeric(Mid(a(i, 1), j, 1)) Then Exit For
Next
If j = 0 Then
a(i, 2) = Val(a(i, 1))
a(i, 3) = 0
ElseIf j = Len(a(i, 1)) Then
a(i, 2) = a(i, 1): a(i, 3) = -1
Else
a(i, 2) = left(a(i, 1), j)
a(i, 3) = Val(Mid(a(i, 1), j + 1))
End If
Next
Call bsort(a, 1, UBound(a) - 1, 1, 3, 1)
For i = 1 To UBound(a) - 1
If a(i, 2) <> a(i + 1, 2) Then
Call bsort(a, p + 1, i, 1, 3, 3)
p = i
End If
Next
[c1].Resize(UBound(a) - 1) = a
End Sub
Function bsort(a, first, last, left, right, key)
Dim i, j, k, t
For i = first To last - 1
For j = first To last + first - 1 - i
If a(j, key) > a(j + 1, key) Then
For k = left To right
t = a(j, k): a(j, k) = a(j + 1, k): a(j + 1, k) = t
Next
End If
Next
Next
End Function