用最后两期配同路,同路后面开新路,错了以后接着打 用尾数012路分析
Sub PredictNextNumber()
Dim lastTwoNumbers As Variant
Dim currentNumber As Variant
Dim path As String
Dim i As Integer, j As Integer
Dim count As Integer
Dim result As Variant
' 获取最后两期奖号
lastTwoNumbers = Range("A2:T2").Value + Range("A3:T3").Value
' 遍历最后两期奖号
For i = 1 To UBound(lastTwoNumbers, 1) - 1
' 如果当前奖号和前一个奖号相同,则预测下一个奖号
If lastTwoNumbers(i, 1) = lastTwoNumbers(i + 1, 1) Then
currentNumber = lastTwoNumbers(i, 1)
count = 2
' 寻找连续相同的奖号数量
Do While i < UBound(lastTwoNumbers, 1) - 1 And lastTwoNumbers(i, 1) = currentNumber
count = count + 1
i = i + 1
Loop
' 如果连续相同的奖号数量大于等于3,则预测下一个奖号是这个数对应的奖号
If count >= 3 Then
result = currentNumber + count Mod 10
Range("A4").Offset(0, i - 1).Value = result
End If
End If
Next i
End Sub