Y
ytayta555
I am the first time here , with this ocasion i say HALOO all , you are
ALL OK ; 2003 , XP;
Here is a clever Macro which give you the combinations of 90 things
taken by 15 ; The 90 individual piece values are assumed to be in
cells A1:A90 , Combins 90 will place the various combinations in
column C, (and this is the problem!) . Here is the Macro :
Sub Combins90()
Dim i1 As Long
Dim i2 As Long
Dim i3 As Long
Dim i4 As Long
Dim i5 As Long
Dim i6 As Long
Dim i7 As Long
Dim i8 As Long
Dim i9 As Long
Dim i10 As Long
Dim i11 As Long
Dim i12 As Long
Dim i13 As Long
Dim i14 As Long
Dim i15 As Long
Dim i16 As Long
Dim i17 As Long
Dim i18 As Long
Dim i19 As Long
Dim i20 As Long
Dim i21 As Long
Dim i22 As Long
Dim i23 As Long
Dim i24 As Long
Dim i25 As Long
Dim i26 As Long
Dim i27 As Long
Dim i28 As Long
Dim i29 As Long
Dim i30 As Long
Dim i31 As Long
Dim i32 As Long
Dim i33 As Long
Dim i34 As Long
Dim i35 As Long
Dim i36 As Long
Dim i37 As Long
Dim i38 As Long
Dim i39 As Long
Dim i40 As Long
Dim i41 As Long
Dim i42 As Long
Dim i43 As Long
Dim i44 As Long
Dim i45 As Long
Dim i46 As Long
Dim i47 As Long
Dim i48 As Long
Dim i49 As Long
Dim i50 As Long
Dim i51 As Long
Dim i52 As Long
Dim i53 As Long
Dim i54 As Long
Dim i55 As Long
Dim i56 As Long
Dim i57 As Long
Dim i58 As Long
Dim i59 As Long
Dim i60 As Long
Dim i61 As Long
Dim i62 As Long
Dim i63 As Long
Dim i64 As Long
Dim i65 As Long
Dim i66 As Long
Dim i67 As Long
Dim i68 As Long
Dim i69 As Long
Dim i70 As Long
Dim i71 As Long
Dim i72 As Long
Dim i73 As Long
Dim i74 As Long
Dim i75 As Long
Dim i76 As Long
Dim i77 As Long
Dim i78 As Long
Dim i79 As Long
Dim i80 As Long
Dim i81 As Long
Dim i82 As Long
Dim i83 As Long
Dim i84 As Long
Dim i85 As Long
Dim i86 As Long
Dim i87 As Long
Dim i88 As Long
Dim i89 As Long
Dim i90 As Long
Dim iRow As Long
iRow = 0
For i1 = 1 To 76
For i2 = i1 + 1 To 77
For i3 = i2 + 1 To 78
For i4 = i3 + 1 To 79
For i5 = i4 + 1 To 80
For i6 = i5 + 1 To 81
For i7 = i6 + 1 To 82
For i8 = i7 + 1 To 83
For i9 = i8 + 1 To 84
For i10 = i9 + 1 To 85
For i11 = i10 + 1 To 86
For i12 = i11 + 1 To 87
For i13 = i12 + 1 To 88
For i14 = i13 + 1 To
89
For i15 = i14 + 1
To 90
iRow = iRow +
1
Cells(iRow, "C") = Cells(i1, "A") + Cells(i2, "A") _
+ Cells(i3, "A") + Cells(i4, "A") _
+ Cells(i5, "A") + Cells(i6, "A") _
+ Cells(i7, "A") + Cells(i8, "A") _
+ Cells(i9, "A") + Cells(i10, "A") _
+ Cells(i11, "A") + Cells(i12, "A") _
+ Cells(i13, "A") + Cells(i14, "A") _
+ Cells(i15, "A")
Next i15
Next i14
Next i13
Next i12
Next i11
Next i10
Next i9
Next i8
Next i7
Next i6
Next i5
Next i4
Next i3
Next i2
Next i1
End Sub
My problem is the next :the number of combinations is very big over
45,000,000 000,000,000 of
combination , and this macro place the various combinations in Column
C only .My question is :
what can I do in this Macro, to place the result in the next Column
after it finish with Column C ?
how can I do to place the result in 100 of contiguous Columns (for
eg: "C:CC") ? Please very much to help me .
ALL OK ; 2003 , XP;
Here is a clever Macro which give you the combinations of 90 things
taken by 15 ; The 90 individual piece values are assumed to be in
cells A1:A90 , Combins 90 will place the various combinations in
column C, (and this is the problem!) . Here is the Macro :
Sub Combins90()
Dim i1 As Long
Dim i2 As Long
Dim i3 As Long
Dim i4 As Long
Dim i5 As Long
Dim i6 As Long
Dim i7 As Long
Dim i8 As Long
Dim i9 As Long
Dim i10 As Long
Dim i11 As Long
Dim i12 As Long
Dim i13 As Long
Dim i14 As Long
Dim i15 As Long
Dim i16 As Long
Dim i17 As Long
Dim i18 As Long
Dim i19 As Long
Dim i20 As Long
Dim i21 As Long
Dim i22 As Long
Dim i23 As Long
Dim i24 As Long
Dim i25 As Long
Dim i26 As Long
Dim i27 As Long
Dim i28 As Long
Dim i29 As Long
Dim i30 As Long
Dim i31 As Long
Dim i32 As Long
Dim i33 As Long
Dim i34 As Long
Dim i35 As Long
Dim i36 As Long
Dim i37 As Long
Dim i38 As Long
Dim i39 As Long
Dim i40 As Long
Dim i41 As Long
Dim i42 As Long
Dim i43 As Long
Dim i44 As Long
Dim i45 As Long
Dim i46 As Long
Dim i47 As Long
Dim i48 As Long
Dim i49 As Long
Dim i50 As Long
Dim i51 As Long
Dim i52 As Long
Dim i53 As Long
Dim i54 As Long
Dim i55 As Long
Dim i56 As Long
Dim i57 As Long
Dim i58 As Long
Dim i59 As Long
Dim i60 As Long
Dim i61 As Long
Dim i62 As Long
Dim i63 As Long
Dim i64 As Long
Dim i65 As Long
Dim i66 As Long
Dim i67 As Long
Dim i68 As Long
Dim i69 As Long
Dim i70 As Long
Dim i71 As Long
Dim i72 As Long
Dim i73 As Long
Dim i74 As Long
Dim i75 As Long
Dim i76 As Long
Dim i77 As Long
Dim i78 As Long
Dim i79 As Long
Dim i80 As Long
Dim i81 As Long
Dim i82 As Long
Dim i83 As Long
Dim i84 As Long
Dim i85 As Long
Dim i86 As Long
Dim i87 As Long
Dim i88 As Long
Dim i89 As Long
Dim i90 As Long
Dim iRow As Long
iRow = 0
For i1 = 1 To 76
For i2 = i1 + 1 To 77
For i3 = i2 + 1 To 78
For i4 = i3 + 1 To 79
For i5 = i4 + 1 To 80
For i6 = i5 + 1 To 81
For i7 = i6 + 1 To 82
For i8 = i7 + 1 To 83
For i9 = i8 + 1 To 84
For i10 = i9 + 1 To 85
For i11 = i10 + 1 To 86
For i12 = i11 + 1 To 87
For i13 = i12 + 1 To 88
For i14 = i13 + 1 To
89
For i15 = i14 + 1
To 90
iRow = iRow +
1
Cells(iRow, "C") = Cells(i1, "A") + Cells(i2, "A") _
+ Cells(i3, "A") + Cells(i4, "A") _
+ Cells(i5, "A") + Cells(i6, "A") _
+ Cells(i7, "A") + Cells(i8, "A") _
+ Cells(i9, "A") + Cells(i10, "A") _
+ Cells(i11, "A") + Cells(i12, "A") _
+ Cells(i13, "A") + Cells(i14, "A") _
+ Cells(i15, "A")
Next i15
Next i14
Next i13
Next i12
Next i11
Next i10
Next i9
Next i8
Next i7
Next i6
Next i5
Next i4
Next i3
Next i2
Next i1
End Sub
My problem is the next :the number of combinations is very big over
45,000,000 000,000,000 of
combination , and this macro place the various combinations in Column
C only .My question is :
what can I do in this Macro, to place the result in the next Column
after it finish with Column C ?
how can I do to place the result in 100 of contiguous Columns (for
eg: "C:CC") ? Please very much to help me .