Hi guys.
I have a problem with printing the result in a external file. I make combinations of all 3 columns, which gives huge number of combinations, like 10Mil combinations, and because there is not enough space in the cells in excel, it gives error after a long time working, but it still gets to the number 1Mil. So I want all those combinations to be written in an external txt file, not in the same file (in this case in the D Row). Do you have a solution to my problem?
Thanks a lot!
Here is my code, and it writes the result into the D column:
Sub comb()
Dim col1 As Range
Dim col2 As Range
Dim col3 As Range
Dim combination As Range
Dim counter
Set combination = Worksheets(1).Range("D:D")
counter = 1
With Worksheets(1)
For Each col1 In .Range("A1", .Range("A" & .Rows.Count).End(xlUp))
For Each col2 In .Range("B1", .Range("B" & .Rows.Count).End(xlUp))
For Each col3 In .Range("C1", .Range("C" & .Rows.Count).End(xlUp))
combination(counter) = col1.Value & "." & col2.Value & "@" & col3.Value
counter = counter + 1
Next col3
Next col2
Next col1
End With
End Sub
So, as I told, I want the result to be written not in D, but in some external text file.
Thanks again
Bookmarks