|
这么热闹,我也来一个:
Sub test()
Dim ar, i&, j&, s, s1, t
t = Timer
ar = [a1].CurrentRegion
For i = 1 To UBound(ar)
s = Split(ar(i, 1), "-")
s1 = Format(s(0), "0000")
For j = 1 To UBound(s)
s1 = s1 & "-" & Format(s(j), "0000")
Next j
ar(i, 1) = s1
s1 = ""
Next i
[b1].Resize(i - 1) = ar
Range("A1:B" & i - 1).Sort Key1:=Range("b1"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
SortMethod:=xlPinYin, DataOption1:=xlSortNormal
[b1].Resize(i - 1) = ""
MsgBox Format(Timer - t, "0.000")
End Sub
|
|