①combin(6,2)的组合
Sub ListCombin()
Dim x, y As Integer
For x = 1 To 5
For y = x 1 To 6
ActiveCell.FormulaR1C1 = x & ", " & y
ActiveCell.Offset(1, 0).Select
Next y
Next x
End Sub
②combin(8,6)的组合
Sub ListCombin()
Dim h, i, j, k, l, m As Integer
For h = 1 To 3
For i = h 1 To 4
For j = i 1 To 5
For k = j 1 To 6
For l = k 1 To 7
For m = l 1 To 8
ActiveCell.FormulaR1C1 = h & "-" & i & "-" & j & "-"& k & "-" & l & "-" & m
ActiveCell.Offset(1, 0).Select
Next m
Next l
Next k
Next j
Next i
Next h
End Sub