Google Answers Logo
View Question
 
Q: Software that will come up with combinations of two separate lists ( Answered 5 out of 5 stars,   0 Comments )
Question  
Subject: Software that will come up with combinations of two separate lists
Category: Computers > Software
Asked by: jpbischke-ga
List Price: $3.00
Posted: 12 Aug 2003 18:13 PDT
Expires: 11 Sep 2003 18:13 PDT
Question ID: 244035
I'm looking for a piece of software that will come up with
combinations of two separate lists.  For instance, let's say I have
the following lists:

List A
------
Blue 
Red 
Yellow

List B
-----
Plane
Car 
Boat

I want a piece of software that will automatically output the
following list:

List C
------
Blue Plane
Blue Car
Blue Boat
Red Plane 
Red Car
Red Boat
Yellow Plane
Yellow Car
Yellow Boat

Alternatively if this could be done using Excel or Word then that also
would be an acceptable answer.  I can't believe this is too hard to do
but haven't been able to figure it out on my own.

Request for Question Clarification by answerguru-ga on 12 Aug 2003 19:16 PDT
Hello,

While this is possible in both MS Excel and Access, you may want to
consider re-evaluating your price as the Excel solution would require
some VBA programming. The Access solution is a little more straight
forward but you have not indicated whether or not you have this
software.

answerguru-ga

Clarification of Question by jpbischke-ga on 14 Aug 2003 02:45 PDT
Unfortunately I don't have Access and even if I did I haven't used it
very much so I'm guessing that might be a bit more difficult for me.

On the other hand, I have done VBA programming in Excel so I might be
more comfortable with that solution.

Request for Question Clarification by answerguru-ga on 14 Aug 2003 07:12 PDT
OK, in that case I can offer two options:

1. Creation of a VBA procedure that performs this process

2. A description of how a VBA procedure would go about accomplishing
this task

Considering your list price, it seems that (2) is the most appropriate
choice, however, if you want a complete VBA macro to do this I suggest
you re-evaluate your list price to account for the level of effort and
time required to complete this type of task.

Thanks,

answerguru-ga

Clarification of Question by jpbischke-ga on 14 Aug 2003 08:35 PDT
Option #2 would be sufficient as my guess is that I would be able to
figure it out from there.  And if isn't sufficient then I can create a
new question asking for the actual procedure code.
Answer  
Subject: Re: Software that will come up with combinations of two separate lists
Answered By: answerguru-ga on 14 Aug 2003 10:33 PDT
Rated:5 out of 5 stars
 
Hi jpbischke-ga,

As requested, here is an outline of how to write a VBA procedure that
will accomplish your desired result:

The best way to go about this is to create two nested 'for' loops such
that "List B" is scanned completely for each row in "List A". Within
the nested loop, you will be able to obtain both the values necessary
to create a concatenation. The resulting string can then be stored in
the appropriate row in "List C". There are a couple ways to determine
the appropriate row for outputting the result (assuming the column
would remain constant):

1. Define a counter that increments each time one iteration of the
inner loop completes and then use that value as your row.

2. Perform a calculation using the indices in your two 'for' loops to
determine the correct row - it seems this would be similar to the
following:

((currentOuterLoopIndex - 1)*totalElementsInListB) +
currentInnerLoopIndex

Hopefully that should get you started - have fun :)

Cheers,

answerguru-ga
jpbischke-ga rated this answer:5 out of 5 stars and gave an additional tip of: $1.00
Great answer.  Thanks for the concise explanation!

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy