I am using this code to clear the bet ref cells when i manually change races and it works great.
But i also need it to clear the cells if the market is suspended early, what happens is some times 5 minutes before the off the market will suspend for a few seconds then return to normal betting but it leaves a market suspended in the bet ref and if i don't see it and try to place a bet it won't work so auto betting is useless right now.
All i need added to the macro is if the market is suspended and the time for the race has not reached zero that it will clear the cells.
- Code: Select all
Private Sub Worksheet_Calculate()
Static MyMarket As Variant
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
If [A1].Value = MyMarket Then
GoTo Xit
Else
MyMarket = [A1].Value
Range("T5:X50").Value = ""
Range("A5:P50").Value = ""
End If
Xit:
Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End Sub