i have use an excel for trading, and i have a problem. I use this VBA for clear status cells.
Code: Select all
Private Sub Worksheet_Calculate()
Application.EnableEvents = False
Dim i As Integer
For i=9 to 69 step 2
If Range("O" & i) = "PLACED" Then
Range("O" & i).ClearContents
End If
Next
Application.EnableEvents = True
End Sub
Many times i get multiple bet from lay or from back or lay bets, and i dont know, why.
The function in cells "L" are very complicated, but the logic:
BACK = O not "Placing (AND) no unmatched BACK bets (AND) matched bets not hedged, or no BACK bets
LAY = O not "Placing" (AND) no unmatched LAY bets (AND) matched bets not hedged (i have a limit value), so i have BACK bet without LAY bet.
If i use only one Excel tab, it works fine, any time!
But if i make 5 excel tabs, i get many times double BACK bets, in same time, for expamle at odds 9.6 at 20:45:15, see my attached screenshot.
If the bet placed, in this case the bets hedged or many stake unmatched, in these cases i dont have BACK or LAY command in "L"), so can be no more bets..