Excel worksheet

Please post any questions regarding the program here.

Moderator: 2020vision

Excel worksheet

Postby sjaak1943 » Sun Nov 04, 2007 5:53 pm

I want the odds in my worksheet from about 7 minutes before the start.
I want to use that odds, during the last seven minutes before the race start.
Don´t know how to do it.
Can anyone help.
sjaak1943
 
Posts: 174
Joined: Tue Oct 31, 2006 9:50 pm
Location: Schagen, the Netherlands

Postby phrenetic » Sun Nov 04, 2007 6:28 pm

You can record the odds 7 minutes before the start of the race by using a VBA macro.

You can use the following macro to put the back odds into column AA and the lay odds into column AB.

Code: Select all
Public sRaceDets As String
Public bBackCopied As Boolean
Public bLayCopied As Boolean

Private Sub Worksheet_Change(ByVal Target As Range)
Dim iRow As Integer
Dim iCol As Integer
Dim cell As Object

For Each cell In Target
  iRow = cell.Row
  iCol = cell.Column

  ' Reset everything if a new race has been loaded
  If iCol = 1 And iRow = 1 Then
    If LCase(cell.Value) <> sRaceDets Then
      sRaceDets = LCase(cell.Value)

      ' Clear any stored odds
      Application.EnableEvents = False
      For theRow = 5 To 45
        Range("AA" & theRow).Value = ""
        Range("AB" & theRow).Value = ""
      Next theRow
      Application.EnableEvents = True
      bBackCopied = False
      bLayCopied = False
    End If
  End If

  ' Copy the Back Odds 7 mins before the off
  If Range("E2").Value = "Not In Play" And Range("D2").Value <= 0.004861 And bBackCopied = False Then
    Application.EnableEvents = False
    For theRow = 5 To 45
      Range("AA" & theRow).Value = Range("F" & theRow).Value
    Next theRow
    Application.EnableEvents = True
    bBackCopied = True
  End If

  If Range("E2").Value = "Not In Play" And Range("D2").Value <= 0.004861 And bLayCopied = False Then
    Application.EnableEvents = False
    For theRow = 5 To 45
      Range("AB" & theRow).Value = Range("H" & theRow).Value
    Next theRow
    Application.EnableEvents = True
    bLayCopied = True
  End If
Next cell
End Sub


Note - I haven't tested this code, but I think it should work.

Alistair
phrenetic
 
Posts: 142
Joined: Tue Oct 16, 2007 8:44 pm


Return to Help

Who is online

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