You can record the odds 7 minutes before the start of the race by using a VBA macro.
You can use the following macro to put the back odds into column AA and the lay odds into column AB.
- Code: Select all
Public sRaceDets As String
Public bBackCopied As Boolean
Public bLayCopied As Boolean
Private Sub Worksheet_Change(ByVal Target As Range)
Dim iRow As Integer
Dim iCol As Integer
Dim cell As Object
For Each cell In Target
iRow = cell.Row
iCol = cell.Column
' Reset everything if a new race has been loaded
If iCol = 1 And iRow = 1 Then
If LCase(cell.Value) <> sRaceDets Then
sRaceDets = LCase(cell.Value)
' Clear any stored odds
Application.EnableEvents = False
For theRow = 5 To 45
Range("AA" & theRow).Value = ""
Range("AB" & theRow).Value = ""
Next theRow
Application.EnableEvents = True
bBackCopied = False
bLayCopied = False
End If
End If
' Copy the Back Odds 7 mins before the off
If Range("E2").Value = "Not In Play" And Range("D2").Value <= 0.004861 And bBackCopied = False Then
Application.EnableEvents = False
For theRow = 5 To 45
Range("AA" & theRow).Value = Range("F" & theRow).Value
Next theRow
Application.EnableEvents = True
bBackCopied = True
End If
If Range("E2").Value = "Not In Play" And Range("D2").Value <= 0.004861 And bLayCopied = False Then
Application.EnableEvents = False
For theRow = 5 To 45
Range("AB" & theRow).Value = Range("H" & theRow).Value
Next theRow
Application.EnableEvents = True
bLayCopied = True
End If
Next cell
End Sub
Note - I haven't tested this code, but I think it should work.
Alistair