下面程序只算出组合,没有排列
Sub 组合5in20()
Dim I1, I2, I3, I4, I5, M
M = 0
For I1 = 1 To 16
For I2 = I1 + 1 To 17
For I3 = I2 + 1 To 18
For I4 = I3 + 1 To 19
For I5 = I4 + 1 To 20
M = M + 1
Range("A" & M) = I1: Range("B" & M) = I2: Range("C" & M) = I3: Range("D" & M) = I4: Range("E" & M) = I5
Next
Next
Next
Next
Next
End Sub