Hi there, i found this vb code the other day on this forum from a post made way back in 2005 i think it was. I've found it really useful for what i wanted to do, but i wonder if it can be expanded or changed to allow for more sets of imformation.
This is the Code, it finds all possible combinations from 3 sets of 3 results.
Code
Option Explicit
Public Sub combinations()
Dim a As Integer, b As Integer, c As Integer
Worksheets(1).Range("A6:IV65536").ClearContents
For a = 2 To 4
For b = 2 To 4
For c = 2 To 4
Worksheets(1).Range("A" & Range("A65536").End(xlUp).Row + 1) = Worksheets(1).Cells(a, 1)
Worksheets(1).Range("B" & Range("B65536").End(xlUp).Row + 1) = Worksheets(1).Cells(b, 2)
Worksheets(1).Range("C" & Range("C65536").End(xlUp).Row + 1) = Worksheets(1).Cells(c, 3)
Next c
Next b
Next a
End Sub
Display More
Could anyone explain how you expand this code to mix, say, 8 sets of 3, or 10 sets of 3, i'm pulling my hair out over this.
Thanks in advance... heres the document as it is now forum.ozgrid.com/index.php?attachment/25939/