Dear all expert
Does anyone can know how to generate all lotto 7/49 combinations ? i saw many website, still cannot find the vba code, the most closest one is
Option Explicit
Dim A As Integer, B As Integer, C As Integer, D As Integer
Dim E As Integer, F As Integer, G As Integer, N As Long
Sub List_Combinations_27()
Range("A1").Select
Application.ScreenUpdating = False
N = 0
For A = 1 To 21
For B = A + 1 To 22
For C = B + 1 To 23
For D = C + 1 To 24
For E = D + 1 To 25
For F = E + 1 To 26
For G = F + 1 To 27
N = N + 1
If N = 65001 Then
N = 1
ActiveCell.Offset(-65000, 8).Select
End If
ActiveCell.Offset(0, 0).Value = A
ActiveCell.Offset(0, 1).Value = B
ActiveCell.Offset(0, 2).Value = C
ActiveCell.Offset(0, 3).Value = D
ActiveCell.Offset(0, 4).Value = E
ActiveCell.Offset(0, 5).Value = F
ActiveCell.Offset(0, 6).Value = G
ActiveCell.Offset(1, 0).Select
Next G
Next F
Next E
Next D
Next C
Next B
Next A
Application.ScreenUpdating = True
End Sub
Does any expert can vary this to All Possible 7/1-49 Lottery Number Combinations. The total is 13983816 combination. Thank you very much.
Thanks in advance,
Isaac
Bookmarks