Q2 trigger

Please post any questions regarding the program here.

Moderator: 2020vision

Q2 trigger

Postby keesbart » Mon Jul 12, 2010 11:12 am

Hi,
I have a problem with moving to the next market by using the Q2 trigger.

I want to move to the next market if the start of the race did not happen after e.g. 5 minutes after the scheduled off time.
In cell AB2 I have put in -0:05:00.
I use also D2 (the time is negative after scheduled off).
In the program I have the following statement
IF RANGE ("D2") < RANGE("AB2") THEN RANGE ("Q2") = -1

What happens is that the program does not move 1 but 2 markets.

Can somebody tell me what I am doing wrong?
keesbart
 
Posts: 153
Joined: Tue Mar 23, 2010 1:06 pm

Postby GaryRussell » Mon Jul 12, 2010 11:51 am

Range("Q2")=-1 generates another worksheet_change event which causes your code to run twice. Disable events to prevent this. It's also best to only run your code during one particular change event and that is when the prices are updating. 16 columns are updated when the prices are updated so your code should be as follows.

Code: Select all
Private Sub Worksheet_Change(ByVal Target As Range)
   If Target.Columns.Count = 16 then
   Application.EnableEvents = false
   ' your code goes here
   Application.EnableEvents = true
End If
User avatar
GaryRussell
Site Admin
 
Posts: 9872
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Postby keesbart » Mon Jul 12, 2010 12:20 pm

Gary thanks for your quick response.
I will change the program as you suggested.
keesbart
 
Posts: 153
Joined: Tue Mar 23, 2010 1:06 pm


Return to Help

Who is online

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