Sub BestPredictor()
Dim Predictions(1 To 7)
For i = 1 To 7
Do
x = Application.RandBetween(1, 37)
y = Application.Match(x, Predictions, 0)
Loop Until IsError(y)
Predictions(i) = x
Next i
MsgBox Join(Predictions, ", ")
End Sub
thanks a lot!This is the best predictor of the next lottery numbers:
Code:Sub BestPredictor() Dim Predictions(1 To 7) For i = 1 To 7 Do x = Application.RandBetween(1, 37) y = Application.Match(x, Predictions, 0) Loop Until IsError(y) Predictions(i) = x Next i MsgBox Join(Predictions, ", ") End Sub
It doesn't run?!it's not function
It doesn't run?!
it's running but the numbers which come out doesn't match with numbers drawn .
The goal is for at least 4/7 numbers to be hit. With your code, score is 0/7.
a) Counting the frequency of each number in a lottery gameHi,you forgot to elaborate what could be your expected result, your strategy, the logic to follow, …
You will not find a better predictor than this. It takes into account the influence of all the previous lottery outcomes.it's running but the numbers which come out doesn't match with numbers drawn .
The goal is for at least 4/7 numbers to be hit. With your code, score is 0/7.
a) Counting the frequency of each number in a lottery game
b) Determine which are "hot" numbers, "cold" numbers and "overdue" numbers within a certain draw period in a lottery game
c) Know how many times a number is paired with another number
Sub Demo1()
Dim S, V, P%, N%
S = ThisWorkbook.Saved
With Application
.ScreenUpdating = False
With [J1:K37].Columns
.Item(1).Value2 = [ROW(1:37)]
.Item(2).Formula = "=COUNTIF($A$1:$G$5,J1)"
.Sort .Item(2), 2, Header:=2
V = .Item(1).Value2
.Clear
End With
ThisWorkbook.Saved = S
.ScreenUpdating = True
Rnd -1: Randomize V(1, 1)
For P = 1 To 7
N = Fix((38 - P) * Rnd) + P: S = V(P, 1): V(P, 1) = V(N, 1): V(N, 1) = S
Next
MsgBox Join(.Small(.Index(V, [ROW(1:7)]), [COLUMN(A:G)]), " - "), , "Predict'one"
End With
End Sub