Hello,</SPAN></SPAN>
I got 14 numbers in cells A5:A18 these numbers are changeable every time but (but always will be the 14 numbers)</SPAN></SPAN>
I need VBA code, which can generate all possible unique combinations with 6 numbers in the columns D:I and sum of each row combination must be 6. Is it possible?</SPAN></SPAN>
Example data</SPAN></SPAN>
Thank you all</SPAN></SPAN>
Excel 2000</SPAN></SPAN>
Regards,</SPAN></SPAN>
Moti</SPAN></SPAN>
I got 14 numbers in cells A5:A18 these numbers are changeable every time but (but always will be the 14 numbers)</SPAN></SPAN>
I need VBA code, which can generate all possible unique combinations with 6 numbers in the columns D:I and sum of each row combination must be 6. Is it possible?</SPAN></SPAN>
Example data</SPAN></SPAN>
Book1 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | |||
1 | ||||||||||||
2 | ||||||||||||
3 | ||||||||||||
4 | Numbers | n1 | n2 | n3 | n4 | n5 | n6 | SUM | ||||
5 | 0 | 0 | 0 | 1 | 1 | 0 | 4 | 6 | ||||
6 | 0 | 0 | 0 | 1 | 1 | 4 | 0 | 6 | ||||
7 | 1 | 0 | 0 | 1 | 1 | 2 | 2 | 6 | ||||
8 | 1 | 0 | 0 | 1 | 0 | 4 | 1 | 6 | ||||
9 | 1 | 0 | 0 | 1 | 4 | 0 | 1 | 6 | ||||
10 | 0 | 0 | 0 | 1 | 4 | 1 | 0 | 6 | ||||
11 | 4 | 0 | 0 | 1 | 2 | 2 | 1 | 6 | ||||
12 | 0 | 0 | 0 | 0 | 4 | 0 | 2 | 6 | ||||
13 | 2 | 0 | 0 | 0 | 4 | 2 | 0 | 6 | ||||
14 | 0 | 0 | 0 | 0 | 2 | 2 | 2 | 6 | ||||
15 | 2 | 0 | 0 | 4 | 0 | 2 | 0 | 6 | ||||
16 | 2 | 0 | 0 | 4 | 0 | 0 | 2 | 6 | ||||
17 | 1 | 0 | 0 | 4 | 2 | 0 | 0 | 6 | ||||
18 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 6 | ||||
19 | 0 | 0 | 2 | 2 | 2 | 0 | 6 | |||||
20 | 0 | 1 | 1 | 1 | 2 | 1 | 6 | |||||
21 | 0 | 1 | 1 | 0 | 4 | 0 | 6 | |||||
22 | 0 | 1 | 1 | 0 | 2 | 2 | 6 | |||||
23 | 0 | 1 | 1 | 4 | 0 | 0 | 6 | |||||
24 | 0 | 1 | 1 | 2 | 0 | 2 | 6 | |||||
25 | 0 | 1 | 1 | 2 | 2 | 0 | 6 | |||||
26 | 0 | 1 | 0 | 4 | 0 | 1 | 6 | |||||
27 | 0 | 1 | 0 | 4 | 1 | 0 | 6 | |||||
28 | 0 | 1 | 0 | 2 | 2 | 1 | 6 | |||||
29 | 0 | 1 | 4 | 0 | 0 | 1 | 6 | |||||
30 | 0 | 1 | 4 | 0 | 1 | 0 | 6 | |||||
31 | 0 | 1 | 2 | 0 | 2 | 1 | 6 | |||||
32 | 0 | 1 | 2 | 2 | 1 | 0 | 6 | |||||
33 | 0 | 4 | 0 | 2 | 0 | 0 | 6 | |||||
34 | 0 | 4 | 0 | 0 | 2 | 0 | 6 | |||||
35 | 0 | 2 | 0 | 2 | 2 | 0 | 6 | |||||
36 | 1 | 1 | 1 | 0 | 2 | 1 | 6 | |||||
37 | 1 | 1 | 1 | 2 | 0 | 1 | 6 | |||||
38 | 1 | 1 | 1 | 2 | 1 | 0 | 6 | |||||
39 | 1 | 1 | 0 | 4 | 0 | 0 | 6 | |||||
40 | 1 | 1 | 0 | 0 | 2 | 2 | 6 | |||||
41 | 1 | 1 | 0 | 2 | 0 | 2 | 6 | |||||
42 | 1 | 1 | 0 | 2 | 2 | 0 | 6 | |||||
43 | 1 | 1 | 4 | 0 | 0 | 0 | 6 | |||||
44 | 1 | 1 | 2 | 0 | 2 | 0 | 6 | |||||
45 | 1 | 0 | 4 | 0 | 0 | 1 | 6 | |||||
46 | 1 | 0 | 4 | 0 | 1 | 0 | 6 | |||||
47 | 1 | 0 | 0 | 2 | 2 | 1 | 6 | |||||
48 | 1 | 0 | 2 | 0 | 2 | 1 | 6 | |||||
49 | 1 | 0 | 2 | 2 | 1 | 0 | 6 | |||||
50 | 1 | 4 | 0 | 0 | 1 | 0 | 6 | |||||
51 | 1 | 2 | 0 | 2 | 1 | 0 | 6 | |||||
Sheet1 |
Thank you all</SPAN></SPAN>
Excel 2000</SPAN></SPAN>
Regards,</SPAN></SPAN>
Moti</SPAN></SPAN>
Last edited: