View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Gary's Student Gary's Student is offline
external usenet poster
 
Posts: 86
Default Generate table of combinations

Thank you both very much.
--
Gary's Student


"Tom Ogilvy" wrote:

http://tinyurl.com/7jqeo

Code previously posted by Myrna Larson. Not a complete solution, but you
could run it multiple times with different number of values in the subsets.

--
Regards,
Tom Ogilvy

"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