標題:
[發問]
VBA
[打印本頁]
作者:
ikboy
時間:
2016-6-7 11:02
標題:
VBA
請問VBA 如何將A列中的 1,2,3,4 枚舉出C列的所有順序組合。
作者:
stillfish00
時間:
2016-6-7 16:33
Sub Test()
Dim x, y
Dim d As Object: Set d = CreateObject("scripting.dictionary")
For Each x In [a1:a4]
d.Add CStr(x), ""
Next
Dim ar: ar = d.Keys
Dim bNew As Boolean
Do
bNew = False
For Each x In d.Keys
For Each y In ar
If Right(x, 1) < y And Not d.exists(x & y) Then
d.Add x & y, ""
bNew = True
End If
Next
Next
DoEvents
Loop While bNew
[c1].Resize(d.Count) = Application.Transpose(d.Keys)
End Sub
複製代碼
回復
1#
ikboy
作者:
ikboy
時間:
2016-6-7 16:54
回復
2#
stillfish00
感謝
歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)