Retrieving all existing Markets

Please post any questions regarding the program here.

Moderator: 2020vision

Retrieving all existing Markets

Postby gizzard » Tue Jul 09, 2013 8:07 am

I want to get all the race times for all of the markets in a specific Pick List.

I'm using Q2 to reload the pick list and select the first market but am having trouble using -1 to go through the markets one by one.

When I use -1 in Q2 it retrieves the next market but doesn't seem to load it fully before going on to the next market. I'm using a check on whether A1 has changed to identify whether the new market has been loaded.

Also, how can I identify when the last market has been reached so that I can use -5 in Q2 to pick the first market again?

A bit of code would be ideal or some tips on how to recognise that the new market has been fully loaded before trying to fetch the next market.
Or a pointer to another post. I couldn't find one.

Thanks
gizzard
 
Posts: 93
Joined: Wed Jun 10, 2009 12:45 pm

Postby alrodopial » Tue Jul 09, 2013 10:33 am

If A1=AAA1 then copy your data, copy A1 to AAA1, place -1 to Q2
If A1<>AAA1 then copy A1 to AAA1

Instead of AAA1 you can chose whatever cell you want or a variant
For the last race use a timer and set ...secs for a macro to be run
alrodopial
 
Posts: 1384
Joined: Wed Dec 06, 2006 9:59 pm

Postby osknows » Tue Jul 09, 2013 12:17 pm

This example forwards the market as soon as the current market goes inplay. You can change this condition to whatever you want.
Cell J3 indicates with "L" if the market is the last in the QPL so will send a -5 to select the first market.

Sheet Object
Code: Select all
Option Explicit

Dim currentMarket As String
Dim nextracetrigger As Boolean


Private Sub Worksheet_Change(ByVal Target As Range)
   
    If Target.Columns.Count <> 16 Then Exit Sub

    Application.EnableEvents = False

    With Target.Parent
   
        If .Range("A1").Value <> currentMarket Then
                'New Market Selected
               currentMarket = .Range("A1").Value
               nextracetrigger = False
        End If

        'forward market at start of inplay
        If .Range("E2").Value = "In Play" And nextracetrigger = False Then
            nextracetrigger = True
            If .Range("J3").Value = "L" Then
                .Range("Q2") = -5
            Else
                .Range("Q2") = -1
            End If
        End If
       
    End With
   
    Application.EnableEvents = True

End Sub
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby gizzard » Tue Jul 09, 2013 1:15 pm

Thanks for both of those fast responses. I will take a look and give it another go. I wasn't awae of the use of J3.
gizzard
 
Posts: 93
Joined: Wed Jun 10, 2009 12:45 pm


Return to Help

Who is online

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