Macro generated data stopping due to row limit

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
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
It would require 7,000 terabytes (3^25 * 2^8 * 33 bytes) to store all that data. What would you do when you had it?
 
Upvote 0
Yup. Permutations and combinations tend to explode.
 
Upvote 0

Forum statistics

Threads
1,224,520
Messages
6,179,266
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top