写的不好,方法太笨,仅供参考- Sub x()
- Dim r, x%, ro%, s%, rng
- ro = [a65500].End(3).Row
- Set r = CreateObject("vbscript.regexp")
- r.Global = True
- r.Pattern = "[^0-9]+|[0-9]+"
- For Each rng In Range("a1:a" & ro)
- s = 1
- For Each mat In r.Execute(rng)
- rng(1, s + 4) = IIf(s = 2, Val(mat), mat)
- s = s + 1
- Next
- Next
- Range("e1").CurrentRegion.Sort key1:=[e1], order1:=xlAscending, key2:=[f1], order2:=xlAscending, Header:=xlNo
- For x = 1 To ro
- Cells(x, 1) = Cells(x, 5) & Cells(x, 6)
- Next
- End Sub
复制代码 |