|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
张雄友 发表于 2015-1-16 07:48
怎么实现效果?
Sub 先排字母后排数字2() ''字母不分大小写
Application.ScreenUpdating = False
Dim arr, s$, a$, b&, i&, k&, m&, n&
arr = Range("a1", [a65536].End(3))
m = UBound(arr)
For i = 1 To m
s = arr(i, 1)
For n = Len(s) To 1 Step -1
If Mid(s, n, 1) Like "[a-zA-Z]" Then
a = Left(s, n)
b = Val(Mid(s, n + 1)) + 10000000
Exit For
End If
Next
k = 10 - Len(a)
arr(i, 1) = a & String(k, "@") & b & "$" & s
Next
[k1].Resize(m) = arr
[k1].Resize(m).Sort [k1], 1
[k1].Resize(m).Replace "*$", ""
Application.ScreenUpdating = True
End Sub
|
评分
-
1
查看全部评分
-
|