|
Sub test0()
Dim ar, br
Dim i As Long, j As Long
ar = Range("A1").CurrentRegion.Columns(1).Value
For i = 2 To UBound(ar)
br = Split(ar(i, 1), "/")
BubbleSort br, LBound(br), UBound(br)
ar(i, 1) = Join(br, "/")
Next
Range("B1").Resize(UBound(ar)) = ar
End Sub
Function BubbleSort(ar, l As Long, r As Long)
Dim i As Long, j As Long, swap As String
For i = l To r - 1
For j = l To r + l - 1 - i
If Val(ar(j)) < Val(ar(j + 1)) Then
swap = ar(j)
ar(j) = ar(j + 1)
ar(j + 1) = swap
End If
Next
Next
End Function |
评分
-
1
查看全部评分
-
|