|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
组合结果分成6列输出的代码:- Sub Combin_33_6_6()
- Dim a%, b%, c%, d%, e%, f%, k&, l%, m&, s$
- ' m = 4 ^ 8 '2003版
- m = 4 ^ 10 '2007版
- ReDim r(1 To m, 1 To 6) '2003或2007版
-
- For a = 1 To 33 - 5
- For b = a + 1 To 33 - 4
- For c = b + 1 To 33 - 3
- For d = c + 1 To 33 - 2
- For e = d + 1 To 33 - 1
- For f = e + 1 To 33
- k = k + 1
- If k > m Then
- Cells(1, l * 7 + 1).Resize(m, 6) = r
- ReDim r(1 To m, 1 To 1) '2003或2007版
- l = l + 1
- k = 1
- End If
- r(k, 1) = a
- r(k, 2) = b
- r(k, 3) = c
- r(k, 4) = d
- r(k, 5) = e
- r(k, 6) = f
-
- Next f, e, d, c, b, a
- Cells(1, l * 7 + 1).Resize(k, 6) = r
- End Sub
复制代码 |
|