I want to achieve the following function in Q2,
- Code: Select all
IF(AND(E2="In Play",F2="Suspended"),-1,"")
It seems that I need VBA to do this.
Can someone point me in the right direction.
Many thanks
Bert
Moderator: 2020vision
by BERTRAND » Mon Feb 20, 2012 8:57 am
IF(AND(E2="In Play",F2="Suspended"),-1,"")
by GaryRussell » Mon Feb 20, 2012 9:44 am
by BERTRAND » Mon Feb 20, 2012 10:21 am
by GaryRussell » Mon Feb 20, 2012 3:52 pm
Option Explicit
Dim currentMarket As String
Dim inPlay As Boolean
Dim inPlayTime As Date
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
inPlayTime = Now
End If
If [F2] = "Suspended" And Not marketChanged And DateDiff("s", inPlayTime, Now) > 20 Then
marketChanged = True
Application.EnableEvents = False
[Q2] = "-1"
Application.EnableEvents = True
End If
Else
inPlay = False
End If
End If
End Sub
by BERTRAND » Tue Feb 21, 2012 3:55 am
by SenseiCRO » Tue Feb 21, 2012 4:03 pm
by osknows » Tue Feb 21, 2012 4:51 pm
by BERTRAND » Wed Feb 22, 2012 1:51 pm
The strength of Gruss Software is that it’s been designed by one of you, a frustrated sports punter, and then developed by listening to dozens of like-minded enthusiasts.
Gruss is owned and run by brothers Gary and Mark Russell. Gary discovered Betfair in 2004 and soon realised that using bespoke software to place bets was much more efficient than merely placing them through the website.
Gary built his own software and then enhanced its features after trialling it through other Betfair users and reacting to their improvement ideas, something that still happens today.
He started making a small monthly charge so he could work on it full-time and then recruited Mark to help develop the products and Gruss Software was born.
We think it’s the best of its kind and so do a lot of our customers. But you can never stand still in this game and we’ll continue to improve the software if any more great ideas emerge.