I have this macro to generate numbers sets once my original number set is matched but the most I can generate is 1048576 sets.
Can this macro be modified to generate more than 1048576 sets? Either on the same spreadsheet or additional spreadsheets?
Sub MakeSets()
Dim Cnt As Long, Cnt2 As Long, NR As Long
Cnt = Application.InputBox("How many sets to create?", "SETS", 2500000, Type:=1)
If Cnt = 0 Then Exit Sub
If MsgBox("Clear current sets?", vbYesNo, "RESET") = vbYes Then
Range("m:p").ClearContents
NR = 1
Else
NR = Range("m" & Rows.Count).End(xlUp).Row + 1
End If
Do
Application.Calculate
If Range("a3").Value = Range("c3").Value Then
For i = 1 To Cnt
Range("a1:d1").Copy
Range("m" & NR).PasteSpecial xlPasteValues
NR = NR + 1
Next i
Exit Do
End If
DoEvents
Loop
Application.CutCopyMode = False
End Sub
Bookmarks