Help with recording odds

Please post any questions regarding the program here.

Moderator: 2020vision

Help with recording odds

Postby eduardoneco » Wed Sep 21, 2016 8:39 am

Hello guys..... It´s been a while since my last visit, but here I'm again.....

What I need from you is 3 "simple" things to rearrange the code that I have ( or I hope they are simple and you can easily help me to solve this).

I have this sheet that records every odds when the market turns in-play in horse racing and I need:

1- to start recording the market pre-live about 10min before the starting off;
2- when the market turns in-play, separate the 2 range of odds (pre-live and in-play) with a line saying "Live";
3- and the last thing is to copy all odds into a new sheet in the end of the race.

This is the code that I have now:

Code: Select all
Option Explicit

Dim currentMarket As String
Dim lastOddsUpdate As Date

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngArray() As Variant
Dim oddsArray(1 To 1, 5 To 54) As Variant
Dim i As Long
   
    If Target.Columns.Count <> 16 Then Exit Sub

    Application.EnableEvents = False

    With Target.Parent
   
        rngArray = .Range("A1:AZ55").Value2
       
        If rngArray(1, 1) <> currentMarket Then
            'New Market Selected
            currentMarket = rngArray(1, 1)
            .Range("AI5:CF1048576").ClearContents
        End If
       
        If rngArray(2, 5) = "In Play" And rngArray(2, 6) <> "Suspended" Then
       
            If DateDiff("s", lastOddsUpdate, rngArray(2, 2)) >= (rngArray(1, 36) * 86400) Then
                lastOddsUpdate = rngArray(2, 2)
                For i = 5 To 50
                    If rngArray(i, 1) = "" Then Exit For
                    oddsArray(1, i) = rngArray(i, 15)
                Next i
                .Range("AI1:CF1").Offset(rngArray(3, 35) + 4, 0).Value = oddsArray
            End If
       
        End If
   
    End With
   
    Application.EnableEvents = True

End Sub



I´m sure is very easy to you, but my knowledge of VBA is a little poor. Hope you can help me on this.

Many thanks in advance and thank you for your attention.

Best regards, Eduardo
eduardoneco
 
Posts: 30
Joined: Thu Feb 14, 2013 5:43 pm

Return to Help

Who is online

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