如何生成由26位英文字母组成4位字母的所有组合是456976个

告诉我怎么生成
2024-12-04 22:42:17
推荐回答(1个)
回答1:

Sub Test()

r = 0
For n1 = 65 To 87
For n2 = n1 + 1 To 88
For n3 = n2 + 1 To 89
For n4 = n3 + 1 To 90
r = r + 1
Range("A" & r) = Chr(n1) & Chr(n2) & Chr(n3) & Chr(n4)
Next
Next
Next
Next
End Sub