发布网友 发布时间:2022-04-23 02:37
共1个回答
热心网友 时间:2023-07-14 01:45
Sub ZH()
s1 = Array("b", "d", "e", "f", "h", "k")
s2 = Array("a", "c", "g")
r = 1
For n1 = 0 To 2
For n2 = n1 + 1 To 3
For n3 = n2 + 1 To 4
For n4 = n3 + 1 To 5
For n5 = 0 To 1
For n6 = n5 + 1 To 2
s = s1(n1) & s1(n2) & s1(n3) & s1(n4) & s2(n5) & s2(n6)
Cells(r, 1) = s
r = r + 1
Next
Next
Next
Next
Next
Next
End Sub
追问我想把一个字母写在一个单元格里 不是把一组6个字母写在一个单元格里 求改一下 谢谢
追答Sub ZH()
s1 = Array("b", "d", "e", "f", "h", "k")
s2 = Array("a", "c", "g")
r = 1
For n1 = 0 To 2
For n2 = n1 + 1 To 3
For n3 = n2 + 1 To 4
For n4 = n3 + 1 To 5
For n5 = 0 To 1
For n6 = n5 + 1 To 2
Cells(r, 1) = s1(n1)
Cells(r, 2) = s1(n2)
Cells(r, 3) = s1(n3)
Cells(r, 4) = s1(n4)
Cells(r, 5) = s2(n5)
Cells(r, 6) = s2(n6)
r = r + 1
Next
Next
Next
Next
Next
Next
End Sub