racebannon
New Member
- Joined
- May 25, 2011
- Messages
- 6
Hi:
I have the following macro that generates all possible value combinations (answers to 33 questions). However the number of combinations is over Excel 2010's row limit. How do I tell it to either save the results to a text file, or stop at a certain row and keep going on another worksheet?
Sub a2zRpt()
Count = 1
For a = 1 To 3
For b = 1 To 3
For c = 1 To 3
For d = 1 To 3
For e = 1 To 2
For f = 1 To 2
For g = 1 To 2
For h = 1 To 2
For i = 1 To 2
For j = 1 To 3
For k = 1 To 3
For l = 1 To 3
For m = 1 To 3
For n = 1 To 3
For o = 1 To 2
For p = 1 To 2
For q = 1 To 3
For r = 1 To 3
For s = 1 To 3
For t = 1 To 3
For u = 1 To 3
For v = 1 To 2
For w = 1 To 3
For x = 1 To 3
For y = 1 To 3
For Z = 1 To 3
For aa = 1 To 3
For ab = 1 To 3
For ac = 1 To 3
For ad = 1 To 3
For ae = 1 To 3
For af = 1 To 3
For ag = 1 To 3
Cells(Count, 3) = Chr(96 + a) & Chr(96 + b) & Chr(96 + c) & Chr(96 + d) & Chr(96 + e) & Chr(96 + f) & Chr(96 + g) & Chr(96 + h) & Chr(96 + i) & Chr(96 + j) & Chr(96 + k) & Chr(96 + l) & Chr(96 + m) & Chr(96 + n) & Chr(96 + o) & Chr(96 + p) & Chr(96 + q) & Chr(96 + r) & Chr(96 + s) & Chr(96 + t) & Chr(96 + u) & Chr(96 + v) & Chr(96 + w) & Chr(96 + x) & Chr(96 + y) & Chr(96 + Z) & Chr(96 + aa) & Chr(96 + ab) & Chr(96 + ac) & Chr(96 + ad) & Chr(96 + ae) & Chr(96 + af) & Chr(96 + ag)
Count = Count + 1
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
End Sub
I have the following macro that generates all possible value combinations (answers to 33 questions). However the number of combinations is over Excel 2010's row limit. How do I tell it to either save the results to a text file, or stop at a certain row and keep going on another worksheet?
Sub a2zRpt()
Count = 1
For a = 1 To 3
For b = 1 To 3
For c = 1 To 3
For d = 1 To 3
For e = 1 To 2
For f = 1 To 2
For g = 1 To 2
For h = 1 To 2
For i = 1 To 2
For j = 1 To 3
For k = 1 To 3
For l = 1 To 3
For m = 1 To 3
For n = 1 To 3
For o = 1 To 2
For p = 1 To 2
For q = 1 To 3
For r = 1 To 3
For s = 1 To 3
For t = 1 To 3
For u = 1 To 3
For v = 1 To 2
For w = 1 To 3
For x = 1 To 3
For y = 1 To 3
For Z = 1 To 3
For aa = 1 To 3
For ab = 1 To 3
For ac = 1 To 3
For ad = 1 To 3
For ae = 1 To 3
For af = 1 To 3
For ag = 1 To 3
Cells(Count, 3) = Chr(96 + a) & Chr(96 + b) & Chr(96 + c) & Chr(96 + d) & Chr(96 + e) & Chr(96 + f) & Chr(96 + g) & Chr(96 + h) & Chr(96 + i) & Chr(96 + j) & Chr(96 + k) & Chr(96 + l) & Chr(96 + m) & Chr(96 + n) & Chr(96 + o) & Chr(96 + p) & Chr(96 + q) & Chr(96 + r) & Chr(96 + s) & Chr(96 + t) & Chr(96 + u) & Chr(96 + v) & Chr(96 + w) & Chr(96 + x) & Chr(96 + y) & Chr(96 + Z) & Chr(96 + aa) & Chr(96 + ab) & Chr(96 + ac) & Chr(96 + ad) & Chr(96 + ae) & Chr(96 + af) & Chr(96 + ag)
Count = Count + 1
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
End Sub