+ Reply to Thread
Results 1 to 7 of 7

Generate all possible outcomes

  1. #1
    Registered User
    Join Date
    05-05-2013
    Location
    London
    MS-Off Ver
    Excel 2011
    Posts
    3

    Generate all possible outcomes

    Hi,

    I would like to be able to generate all the possibles outcomes from three columns with numbers and letters.
    The result should pop up in a different column and the order of the numbers and letters should stay the same and not change, e.g. A0101 is nothing I need. It should generate the possibilities as shown below if possible.

    I am very new to VBA and Macros and I have a deadline for a work assignment and I could really need a hand with this.

    01 A 01
    02 B 02
    03 C 03

    --->

    01A01
    01A02
    01A03
    02A01
    02A02
    02A03
    03A01
    03A02
    03A03
    01B01
    01B02
    etc.

    The real problem includes 12 numbers in each column and 5 different letters and I would like to be able to change the amount of numbers, letters and columns if needed.

    If someone could help me with this it would be very appreciated!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Generate all possible outcomes

    One way:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    05-05-2013
    Location
    London
    MS-Off Ver
    Excel 2011
    Posts
    3

    Re: Generate all possible outcomes

    Thank you! You really saved me!

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Generate all possible outcomes

    You're welcome. Thanks for the rep.


    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Generate all possible outcomes

    Re: your PM, to add points/dots between the elements:

    Please Login or Register  to view this content.

    Regards, TMS

  6. #6
    Registered User
    Join Date
    05-05-2013
    Location
    London
    MS-Off Ver
    Excel 2011
    Posts
    3

    Re: Generate all possible outcomes

    Thank you!

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Generate all possible outcomes

    There's a workbook with both VBA- and formula-based methods for doing this, for any number of columns, at https://www.box.com/s/47b28f19d794b25511be
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1