Football Macro

Please post any questions regarding the program here.

Moderator: 2020vision

Football Macro

Postby thunderfoot » Sat Nov 20, 2010 12:22 pm

I know this will be "Simples" but .....

Have loaded all todays football matches, that have a Correct Score market, to the Quick Pick list, and because a large number start at the same time the 'Clear Bet Refs on Auto Select market' won't do what I want.

I want the Bet Ref, Bet Time, Av. Matched Odds, Matched Stake and Profit/Loss Area (called this 'Bet_Area') to clear when I manually select the next fooball game, so when cell A1 changes the 'Bet-Area' is cleared.

Got this bit of code but ain't working :-

Code: Select all
Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.Address = "$A$1" Then
    Application.Goto Reference:="Bet_Area"
    Selection.ClearContents
    Range("Q4").Select
    End If

End Sub
User avatar
thunderfoot
 
Posts: 270
Joined: Sat Nov 19, 2005 2:52 pm
Location: West Country

Postby GaryRussell » Sat Nov 20, 2010 12:36 pm

That code assumes that cell A1 will be updated by itself and also that it's only updated when the market changes. That doesn't happen. It's updated at the same time as the odds on every refresh.

You need to record the contents of cell A1 in a variable and then compare on each update.

The code below would be more appropriate. I haven't tested it though.

Code: Select all
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Columns.Count=16 Then
       If [A1]<>currentMarket then
          Application.EnableEvents=False
          Application.Goto Reference:="Bet_Area"
          Selection.ClearContents
          Range("Q4").Select
          Application.EnableEvents=True
       End If
       currentMarket=[A1]
    End If
End Sub
User avatar
GaryRussell
Site Admin
 
Posts: 9872
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Postby thunderfoot » Sat Nov 20, 2010 1:03 pm

Nah! Didn't work :cry:

Don't know if it makes any difference but I'm using EXCEL 2003 and the 'old' Betfair Trader (pre-release ver 0.99z30).
User avatar
thunderfoot
 
Posts: 270
Joined: Sat Nov 19, 2005 2:52 pm
Location: West Country

Postby GaryRussell » Sat Nov 20, 2010 1:31 pm

Why do you want to use the old Betfair Trader? What's wrong with Betting Assistant?

It does make a difference because that version does not update the same number of columns.
User avatar
GaryRussell
Site Admin
 
Posts: 9872
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Postby GaryRussell » Sat Nov 20, 2010 1:37 pm

It's 13 columns in Betfair Trader so it should be as follows, but I am no longer developing this version so if you run into problems I recommend you use the latest version of Betting Assistant so I can provide better support.

Code: Select all
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Columns.Count=13 Then
       If [A1]<>currentMarket then
          Application.EnableEvents=False
          Application.Goto Reference:="Bet_Area"
          Selection.ClearContents
          Range("Q4").Select
          Application.EnableEvents=True
       End If
       currentMarket=[A1]
    End If
End Sub
User avatar
GaryRussell
Site Admin
 
Posts: 9872
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Postby thunderfoot » Sat Nov 20, 2010 6:31 pm

Hi Gary,

Thanks for this ..... using the 'old' BT 'cos I'm testing. Once I'm happy that BT does what I want then I'll switch over.
User avatar
thunderfoot
 
Posts: 270
Joined: Sat Nov 19, 2005 2:52 pm
Location: West Country


Return to Help

Who is online

Users browsing this forum: No registered users and 39 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.