Ran in 2007 and it filled 13 sheets, with 352,328 lines in sheet 14 (took about 90 minutes, 324mb file...!)
13 * 1,048,576 + 352,328 = 13,983,816
So if your maths was right to begin with, I'd say that's job done
Code:
Sub allLottery()
Dim x As Long
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With
x = doTheLott("", 1, 1)
With Application
.StatusBar = False
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
End With
ActiveWorkbook.Save
End Sub
Function doTheLott(ByVal xStr As String, r As Long, a As Integer) As Long
Dim xArr As Variant, i As Integer
xArr = Split(Trim(xStr), " ")
If UBound(xArr) = 5 Then
Cells(r, 1).Resize(1, 6).Value = xArr
r = r + 1
If r > Rows.Count Then
Sheets.Add
ActiveWorkbook.Save
r = 1
End If
Else
For i = a To 49
j = Format(i, "00")
If InStr(xStr, j) = 0 Then
r = doTheLott(xStr & j & " ", r, i)
End If
Next
End If
doTheLott = r
End Function
Mind you, I wouldn't try running it on 2003 again...
Hi,
Please help on this, How to insert below conditions on above mentioned code
Generate only those six digits, if below conditions is full-filled
At least one number from P#1 16,20,25,34,45 & Two numbers from P#2 5,6,8,15,18,49
For Example
1,3,5,16,36,49 Display in Excel File – From P#1 at least One number is available & P#2 Two number available
2,7,9,30,35,46 Shouldn’t display in Excel file – From P#1 at least One number is not available & P#2 Two numbers is
not available
5,6,21,26,33,44 Shouldn’t display in Excel File – From P#1 at least One number is
not available & P#2 Two numbers is available
15,20,22,33,36,47 Shouldn’t display in Excel file – From P#1 at least One number is available & P#2 Two numbers is
not available
5,7,9,20,23,44 Shouldn’t display in Excel file – From P#1 at least One number is available & P#2
less than Two numbers is available
5,6,8,20,23,44 Shouldn’t display in Excel file – From P#1 at least One number is available & P#2
More than Two numbers is available
5,6,16,20,33,44 Display in Excel File – From P#1 at least One number is available (More than 1 allowed) & P#2 Two numbers is available
Thanks in advance !!
Regards
Raj