|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub s()
Application.ScreenUpdating = False
Dim arr: arr = Sheet1.Range("b1").CurrentRegion.Value
ReDim ar(1 To UBound(arr), 1 To 2)
For i = 2 To UBound(arr)
ar(i, 1) = Split(arr(i, 1), "、")(0)
ar(i, 2) = "'" & Format(Split(arr(i, 1), "+")(1), "0000")
Next
Sheet1.Range("c1").Resize(UBound(arr), 2) = ar
Range("b1:d" & UBound(arr)).Sort Key1:=Columns("c"), order1:=xlAscending, Key2:=Columns("d"), order2:=xlAscending, Header:=xlNo
Sheet1.Columns("c:d").Delete
Application.ScreenUpdating = True
MsgBox "按关键+后面数字升序排列完成!"
End Sub
|
|