Clearing the bet reference column

Please post any questions regarding the program here.

Moderator: 2020vision

Clearing the bet reference column

Postby Drunkenight » Wed Apr 29, 2009 12:07 am

I am clearing the bet ref column using the following macro:-

Range("T5:T42").Select
Selection.ClearContents
Application.OnTime Now + TimeValue("00:00:12"), "betfair9"
End Sub

This clears the bet reference column every 12 seconds and allows another bet to be triggered.

The problem is that I am placing fill or kill triggered bets and sometimes the Bet ref cell is updating the 'cancelled' reference from the fill or kill bet, just when I am trying to clear the bet ref column.

This results in no bet being placed until the next time the macro clears the bet reference column.

I can't help thinking that I am doing this sub-optimally. Any suggestions?
Is there any way to not receive the 'cancelled' confirmation from BA?

Any help would be greatly appreciated.
Drunkenight
 
Posts: 247
Joined: Thu Apr 02, 2009 1:38 pm

Postby GaryRussell » Wed Apr 29, 2009 9:49 am

I think what you are doing is fine, you just need to allow for CANCELLED being inserted after fill or kill. You can put the following code in the worksheet change event which will check if CANCELLED appears in the bet ref each time it is updated by Betting Asssistant. If it appears it will be removed.

Code: Select all
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim res As Range
    If Target.Row = 5 And Target.Column = 20 Then
        Application.EnableEvents = False
        Do
            Set res = Target.Find("CANCELLED")
            If Not (res Is Nothing) Then
                res.Value = ""
            End If
        Loop Until res Is Nothing
        Application.EnableEvents = True
    End If
End Sub
User avatar
GaryRussell
Site Admin
 
Posts: 9872
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Postby mak » Fri Oct 09, 2009 7:04 pm

GaryRussell wrote:I think what you are doing is fine, you just need to allow for CANCELLED being inserted after fill or kill. You can put the following code in the worksheet change event which will check if CANCELLED appears in the bet ref each time it is updated by Betting Asssistant. If it appears it will be removed.

Code: Select all
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim res As Range
    If Target.Row = 5 And Target.Column = 20 Then
        Application.EnableEvents = False
        Do
            Set res = Target.Find("CANCELLED")
            If Not (res Is Nothing) Then
                res.Value = ""
            End If
        Loop Until res Is Nothing
        Application.EnableEvents = True
    End If
End Sub



Gary (or someone familiar) can you please "change" this code to clear bet ref specific times? 2 times only for example?
mak
 
Posts: 1086
Joined: Tue Jun 30, 2009 8:17 am


Return to Help

Who is online

Users browsing this forum: Bing [Bot] and 46 guests

Sports betting software from Gruss Software


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.