I tried posting the request below, but posted in the wrong section..
If anyone can help it would be appreciated
By the way; my VBA knowledge is very basic
Thanks
Owen
Morning,
This is my first post on Gruss
I've been around a while, mainly using Excel automation since late 2006 and done very well over the years. I've recently tried Gruss and found some very neat features
Just looking for some VBA assistance if anyone can help please? On busy days, like today or bank hols, I want to catch every race if possible. My preferred method is to play in play bets mainly mid race to the end and I want to catch as many races as possible.
If I use the "Auto Select Market" ) seconds, I sometimes miss the best part of the race (the closing stages) and would rather switch at the end of the current race.
Ive been using a sample spreadsheet provided by Gary listed in the sample section that displays:-
Actual Start time in cell AA1
In Play seconds in cell AA2
In Conjunction, it also submit a "-1" into cell Q2 after each suspension to switch to the next race in the pick list. Works like clockwork - great stuff
This is the code it uses:
- Code: Select all
Option Explicit
Dim currentMarket As String
Dim inPlay As Boolean
Dim marketChanged As Boolean
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Columns.Count = 16 Then
If [A1] <> currentMarket Then
currentMarket = [A1]
inPlay = False
marketChanged = False
End If
If [E2] = "In Play" Then
If Not inPlay Then
inPlay = True
End If
If [AA1] = "" Then
[AA1] = [C2]
End If
If [AA1] <> "" Then
[AA2] = DateDiff("s", [AA1], [C2])
End If
If [F2] = "Suspended" And Not marketChanged Then
marketChanged = True
Application.EnableEvents = False
[Q2] = "-1"
Application.EnableEvents = True
End If
Else
inPlay = False
End If
If [E2] <> "In Play" And [F2] <> "Suspended" Then
[AA1] = ""
[AA2] = ""
End If
End If
End Sub
The problem I have seen is that if a race is delayed, it sticks on that race.
I was wondering if anyone had amended the code to correct this in some way? For example it may be able to compare the scheduled start time with the current time and that time was greater than say, 7 mins, switch anyway? (on the assumption that that race has been delayed)
Any help appreciated or better suggestions?
Thanks
Owen