BA VBA Basics!

Discuss anything related to using the program (eg. triggered betting tactics)

Moderator: 2020vision

Re: BA VBA Basics!

Postby negapo » Wed Sep 24, 2014 6:12 pm

Hi MiniBlueDragon

The code is not making a lot of sense. Every time the code runs the variable CurrentMarketID is set to be the value in Sheets("Gruss").Range("N3").Value, then you dump the value in Sheets("Race Card").Range("D1").Value and then you ask if the value of CurrentMarketID is different then Me.Cells(3, "N") which is the same that Sheets("Gruss").Range("N3").Value. So this can never work

try this

Code: Select all
Public CurrentMarketID As Long
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Columns.Count <> 16 Then Exit Sub
    Application.EnableEvents = False
    ' First time the code runs Get current Market ID
    If CurrentMarketID = 0 Then CurrentMarketID = Sheets("Gruss").Range("N3").Value

    'Check if Market ID changes
    If CurrentMarketID <> Sheets("Gruss").Range("N3").Value Then
        CurrentMarketID = CurrentMarketID = Sheets("Gruss").Range("N3").Value
        GetCard 'Run GetCard method
    End If
    Application.EnableEvents = True

End Sub
Posts: 179
Joined: Thu Mar 19, 2009 1:17 pm
Location: Porto, Portugal

Re: BA VBA Basics!

Postby doncht » Wed Oct 08, 2014 2:19 pm

Hi MiniBlueDragon, just curios onto this if you have ran the test already. Did this worked?
User avatar
Posts: 57
Joined: Thu Mar 27, 2014 4:29 pm

Re: BA VBA Basics!

Postby MiniBlueDragon » Wed Oct 08, 2014 9:57 pm

doncht wrote:Hi MiniBlueDragon, just curios onto this if you have ran the test already. Did this worked?

If memory serves there's a standard Variable built into BA that can be checked to see if the market has changed (currentMarket) so I use something along the lines of:

Code: Select all
Dim currentMarket As String

Private Sub Worksheet_Change(ByVal Target As Range)
   If Target.Columns.Count <> 16 Then Exit Sub
   Application.EnableEvents = False
   ' Check if currentMarket has changed
   If [A1] <> currentMarket Then
        currentMarket = [A1]
        marketChanged = True
      GetCard 'Run GetCard method
        marketChanged = False
    End If
   Application.EnableEvents = True
End Sub
Posts: 130
Joined: Tue Jul 05, 2011 1:14 pm
Location: London


Return to Discussion

Who is online

Users browsing this forum: Bing [Bot] and 8 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.