every possible combination of the contents of 2 columns in excel

this should do it:

Sub combineTwoCol()

    ' i,j,k are counters for first col, second col and the answer col in order.
    k = 1
    For i = 1 To 1000
        For j = 1 To 10
            Cells(k, "C").Value = Cells(i, "A").Value
            Cells(k, "D").Value = Cells(j, "B").Value 
            k = k + 1
        Next j
    Next i
End Sub

edited: you should notice that i assumed you have only those two columns is the file, if not change “A” and “B” to the corrosponding columns you need. and “C” and “D” to where you want the two output columns to be.

also if the 10 and 1000 are just examples and not really the values you can always find them dynamically like this:

'this return to the variable the last row in column A
LastRowColA = Range("A65536").End(xlUp).Row

and replace 1000 with LastRowColA

Leave a Comment