LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Create programmatically list of combinations for choices from data sets in excel vba

Hi all,

I am wondering if anyone knows of a neat way to do this:-
Say I have 3 data sets
Data set 1 is {Red,Blue,Green}
Data set 2 is {Car, Lorry}
Data set 3 is {Small,Large}

Is there a way of programmatically creating a list of combinations of
selections from these groups.
I know there are 3*2*2 = 12 combinations
I would like to create a list such as

Red Car Small
Red Car Large
Red Lorry Small
Red Lorry Large
Blue Car Small
Blue Car Large
Blue Lorry Small
Blue Lorry Large
Green Car Small
Green Car Large
Green Lorry Small
Green Lorry Large

I would like this list to always total the number of combinations
dependant on the number of data sets and elements in this set. I want a
pure procedure to handle x data sets each with however many elements.

I have each data set under headings in a spreadsheet.

I have got so far with the code and become unstuck.

Any help appreciated,

somethinglikeant

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a list of permutations and combinations? Malcolm Excel Discussion (Misc queries) 3 May 20th 23 03:44 AM
How to create a macro in excel so that it can generate a list ofunique records using all permutations and combinations of the data in eachrow ad column Rizwan[_4_] Excel Discussion (Misc queries) 1 August 6th 09 01:44 PM
How to create a complete list of combinations from 5 options Nevermore Excel Discussion (Misc queries) 6 July 5th 09 04:04 PM
using excel to create data sets David Biddulph[_2_] Excel Discussion (Misc queries) 0 March 18th 09 08:54 AM
Generate all possible combinations from three data sets? Flamikey[_6_] Excel Programming 2 October 8th 04 11:20 PM


All times are GMT +1. The time now is 05:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"