Help with recording odds

Looking for someone to program in Excel for you?
Forum rules
Developers: Please contact Gavin to request permission before you begin posting here.

Users: For each new project, please simply post an outline of your requirements in a new topic. Thereafter you can of course liaise directly with any developer to discuss any confidential aspects of the project if you feel that is necessary (for example via email or private message). By posting publicly initially, you will be helping to create interest in Find A Developer. It will also help to show that jobs are being completed successfully and thus encourage other users. The busier it becomes the better it will be for everyone.

Cymatic is unable to do bespoke programming work for individual users, but if you post your requirements here, then other professional programmers might offer to do the work for a fee. Cymatic accepts no liability and we do not check the credentials of respondents. So please ask appropriate questions or seek references before accepting a quotation.

Please also keep in mind that after your Cymatic free trial expires, you would need a paid Cymatic subscription in order to continue using Cymatic with spreadsheets. So please don't pay for customizations to spreadsheets without realizing this possibility. Thank you.

Help with recording odds

Postby eduardoneco » Sun Sep 25, 2016 11:07 pm

Hello guys..... I have this Workbook that record the odds for horse racing (I think it suits another sports).

I need 2 "simple" things to rearrange the code that I have ( or I hope they are simple and you can easily help me to solve this). The code records already every odds 10 min. before off, but I need:

1- Differentiate the pre-live and live odds. I´m thinking to put an "x" at the final of each raw on the pre-live odds, that would be in the column CG.
2- At the end of the race, copy all odds and save them in a new workbook with the name of the market (ex. Fairy 11th Jan - 16:00 2m INHF).

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, 23) = "1" Or 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



My knowledge of VBA is very poor. Hope you can help me on this.

Many thanks in advance and thank you for your attention.

Best regards, Eduardo
eduardoneco
 
Posts: 8
Joined: Sat Nov 07, 2015 2:14 pm

Re: Help with recording odds

Postby nig299 » Wed Sep 28, 2016 12:11 pm

As it stands, most of the code will have to be re-written and it would probably be better to re-design it altogether.

The inplay/suspended cells are different and several of the Cymatic columns are over-written with the program data.

As far as I can see it currently only gets the £ amount from column O and transposes it to AL6, then when it runs again this info is over-written with the new data, so you're only getting 1 lot of data in the same cells?

You mention recording the in-play data as well. Have you considered what happens if races overlap and you want to trade the next race before the current one has finished?

Post exactly what info you need recording & how often, runner names, back prices, traded amounts, etc etc, I'm sure someone can help

Nigel.
nig299
 
Posts: 99
Joined: Thu Nov 28, 2013 2:07 am


Return to Excel - Find A Developer

Who is online

Users browsing this forum: No registered users and 0 guests

cron