+ Reply to Thread
Results 1 to 3 of 3

Creating facotrial lists???!

Hybrid View

  1. #1
    Registered User
    Join Date
    11-06-2007
    Posts
    6

    Creating facotrial lists???!

    Hi,

    If I have four lists containing data fields e.g.

    Name Age Hobby Address
    Jon 19 football
    Ben 20 squash
    Phil 30 WC3 4RF
    Keith 40

    I want to create one list of all possible combinations of the other list (excluding blank data).

    e.g. the above data would have a list of:

    Total list
    Jon 19 Football WC3 4RF
    Ben 19 Football WC3 4RF
    Phil 19 football WC3 4RF
    Keith 19 Football WC3 4RF
    Jon 20 football WC3 4RF

    etc etc

    Any ideas?

    Thanks,

  2. #2
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    If the data is in the cells starting A1

    Sub test()
    x = 1
    
    For x1 = 1 To 4
    For x2 = 1 To 4
    For x3 = 1 To 2
    For x4 = 1 To 1
    
    
    Cells(x, 6).Value = Cells(x1, 1)
    Cells(x, 7).Value = Cells(x2, 2)
    Cells(x, 8).Value = Cells(x3, 3)
    Cells(x, 9).Value = Cells(x4, 4)
    x = x + 1
    
    
    Next x4
    Next x3
    Next x2
    Next x1
    
    End Sub
    Regards

    Dav

  3. #3
    Registered User
    Join Date
    11-06-2007
    Posts
    6
    Brilliant! Thanks

+ 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