|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub Main()
- Dim d As Object
- Set d = CreateObject("scripting.dictionary")
-
- ar = [a2:a2325]
- For Each x In ar
- s = SortNum(Format(x, "00000"))
- For k = 1 To 5
- a = Left(s, k - 1) & Mid(s, k + 1)
- If Not d.exists(a) Then Set d(a) = CreateObject("scripting.dictionary")
- d(a)(x) = ""
- Next
- Next
- ReDim br(1 To UBound(ar) + 1, 1 To d.Count)
- For Each a In d.keys
- j = j + 1
- br(1, j) = a
- i = 1
- For Each x In d(a).keys
- i = i + 1
- br(i, j) = x
- Next
- Next
- [f5].Resize(UBound(br), UBound(br, 2)) = br
- Set d = Nothing
-
- End Sub
- Function SortNum(n)
- Dim ar(9) As String
- For i = 1 To Len(n)
- ar(Mid(n, i, 1)) = Mid(n, i, 1)
- Next
- SortNum = Join(ar, "")
- End Function
复制代码
|
评分
-
1
查看全部评分
-
|