+ Reply to Thread
Results 1 to 6 of 6

VBA to Create Permutations of different rows

  1. #1
    Registered User
    Join Date
    04-22-2014
    Location
    NYC
    MS-Off Ver
    Excel 2013
    Posts
    8

    VBA to Create Permutations of different rows

    Hello all,

    I have been looking for resources to answer this question for some time now but none have been quite exactly what I need. I am currently learning the VBA language and need some help on a simple permutation problem that will most likely requires nested loops. I need a list of every possible permutation of words in a row broken out by column. Order does matter and not every row has the same number of words in it. Any help would be very much appreciated! I have attached a sample worksheet with a sample table and then the needed output format. Thank you!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    04-22-2014
    Location
    NYC
    MS-Off Ver
    Excel 2013
    Posts
    8

    Re: VBA to Create Permutations of different rows

    Just was wondering if anyone had any suggestions? Thank you again!

  3. #3
    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: VBA to Create Permutations of different rows

    There's a workbook at https://app.box.com/shared/f3puhccnqa that will do this:

    m Jim Chris Owen
    1 Jim
    1 Chris
    1 Owen
    2 Chris Jim
    2 Jim Chris
    2 Owen Jim
    2 Jim Owen
    2 Owen Chris
    2 Chris Owen
    3 Owen Chris Jim
    3 Owen Jim Chris
    3 Chris Owen Jim
    3 Chris Jim Owen
    3 Jim Owen Chris
    3 Jim Chris Owen
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    04-22-2014
    Location
    NYC
    MS-Off Ver
    Excel 2013
    Posts
    8

    Re: VBA to Create Permutations of different rows

    Hi, thank you for the response! I have actually seen that worksheet but the only problem with it is that I have a particularly large data set I am working with (about 16000 rows). The data sheet I posted was just meant to give an idea of the problem I was facing (I can't post the real data due to sensitivity issues). I would not be able to post each delimited text string into that worksheet individually in order to get the permutations from that worksheet.

  5. #5
    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: VBA to Create Permutations of different rows

    Feel free to adapt the code as you wish.

  6. #6
    Registered User
    Join Date
    04-22-2014
    Location
    NYC
    MS-Off Ver
    Excel 2013
    Posts
    8

    Re: VBA to Create Permutations of different rows

    Hey SHG,

    I would love to but unfortunately, I am really not sure how. Any suggestions?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Generating Permutations in rows
    By sajeel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-09-2013, 05:47 AM
  2. Create Combinations and permutations from 27 numbers
    By theborg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-18-2012, 02:28 AM
  3. Permutations
    By kajabiwan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2012, 01:08 PM
  4. Permutations
    By alan73 in forum Excel General
    Replies: 3
    Last Post: 11-07-2011, 06:37 PM
  5. How do I create non recurring permutations
    By andrewblack in forum Excel General
    Replies: 0
    Last Post: 02-15-2006, 08:54 PM

Tags for this Thread

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