从1到11这11个数中任意取9个数出来为一个组合,谁帮我用EXCEL把全部组合...

发布网友 发布时间:2024-10-23 16:59

我来回答

1个回答

热心网友 时间:2分钟前

实在太多,你自己运行下这个宏命令吧。
Sub suiji()
Dim s(10)
For x = 0 To 10
s(x) = x
Next
l = 1
m = 1
For a = 1 To 11
For b = 1 To 11
For c = 1 To 11
For d = 1 To 11
For e = 1 To 11
For f = 1 To 11
For g = 1 To 11
For h = 1 To 11
For l = 1 To 11
If a <> b And a <> c And a <> d And a <> e And a <> f And a <> g And a <> h And a <> l And b <> c And b <> d And b <> e And b <> f And b <> g And b <> l And c <> d And c <> e And c <> f And c <> g And c <> h And c <> l And d <> e And d <> f And d <> g And d <> h And d <> l And e <> f And e <> g And e <> g And e <> h And e <> l And f <> g And f <> h And f <> l And g <> h And g <> l And h <> l Then
Cells(l, m) = a & "," & b & "," & c & "," & d & "," & e & "," & f & "," & g & "," & h & "," & l
l = l + 1
End If
If (l > 65536) Then
m = m + 1
l = 1
End If
Next
Next
Next
Next
Next
End Sub

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com