Posted to microsoft.public.excel.programming
|
|
Generate table of combinations
Hi,
Have a look at this:
http://www.excelforum.com/archive/in.../t-258299.html
Regards,
KL
"Gary's Student" wrote in message
...
Can anyone point me to an algorithm or VBA code to produce a table of
combination of items. For example if the items are 1,2,3,4,5 then the
code
would generate:
1
1, 2
1, 2, 3
1, 2, 3, 4
1, 2, 3, 5
1, 2, 3, 4, 5
1, 2, 4
1, 2, 4, 5
1, 2, 5
1, 3
1, 3, 4
1, 3, 4, 5
1, 3, 5
1, 4
1, 4, 5
1, 5
2
2, 3
2, 3, 4
2, 3, 4, 5
2, 3, 5
2, 4
2, 4, 5
2, 5
3
3, 4
3, 4, 5
3, 5
4
4, 5
5
Similar for dog, cat, house
--
Gary's Student
|