trpltongue
New Member
- Joined
- Aug 27, 2009
- Messages
- 23
Hello all,
I've been reading and working like crazy trying to make a silly thing work in excel vba and am at a roadblock.
I have a set of 30 numbers 1-30 that I want to place into 3 groups of 5, for example:
Group 1 - 1,2,3,4,5
Group 2 - 6,7,8,9,10
Group 3 - 11,12,13,14,15
However, each number can be used only once, so I cannot have for example:
Group 1 - 1,2,3,4,5
Group 2 - 5,4,3,2,1
Group 3 - 6,7,8,9,10
I'd like to use vba to generate all of the unique families of 3 groups of 5 numbers automatically.
So something like:
Family 1:
Group 1 - 1,2,3,4,5
Group 2 - 6,7,8,9,10
Group 3 - 11,12,13,14,15
Family 2:
Group 1 - 1,2,3,4,5
Group 2 - 6,7,8,9,10
Group 3 - 11,12,13,14,16
Family 3:
Group 1 - 1,2,3,4,5
Group 2 - 6,7,8,9,10
Group 3 - 11,12,13,14,17
Etc.
I've read all through Myrna Larson's code and have no problem generating all of the possible 5 number combinations, it's just putting them into unique 3-group combinations that is troublesome.
Thanks so much for any help.
I've been reading and working like crazy trying to make a silly thing work in excel vba and am at a roadblock.
I have a set of 30 numbers 1-30 that I want to place into 3 groups of 5, for example:
Group 1 - 1,2,3,4,5
Group 2 - 6,7,8,9,10
Group 3 - 11,12,13,14,15
However, each number can be used only once, so I cannot have for example:
Group 1 - 1,2,3,4,5
Group 2 - 5,4,3,2,1
Group 3 - 6,7,8,9,10
I'd like to use vba to generate all of the unique families of 3 groups of 5 numbers automatically.
So something like:
Family 1:
Group 1 - 1,2,3,4,5
Group 2 - 6,7,8,9,10
Group 3 - 11,12,13,14,15
Family 2:
Group 1 - 1,2,3,4,5
Group 2 - 6,7,8,9,10
Group 3 - 11,12,13,14,16
Family 3:
Group 1 - 1,2,3,4,5
Group 2 - 6,7,8,9,10
Group 3 - 11,12,13,14,17
Etc.
I've read all through Myrna Larson's code and have no problem generating all of the possible 5 number combinations, it's just putting them into unique 3-group combinations that is troublesome.
Thanks so much for any help.