Setting VBA using Time before a race starts.

Discuss anything related to using the program (eg. triggered betting tactics)

Moderator: 2020vision

Re: Setting VBA using Time before a race starts.

Postby Captain Sensible » Tue Nov 09, 2021 7:32 pm

Sussexguy44 wrote:Re Previous, the trigger formula does not work just now.


By trigger formula do you mean your formula in column AE or the trigger formula in column Q? Both look simple enough formulas and if anything could all be combined in the Q column or add $E$2="Not In Play" to your AE formula to tidy things up

Code: Select all
=IF(AND($D$2<=TIMEVALUE("00:00:30"),AB5>=4,$E$2="Not In Play"),"1","0")

And

= IF(AE5=1,"BACK","")


Easiest way to try and check for errors is just to unlink your excel sheet from BA and put in figures manually to try and find where the error is occuring, like I mentioned earlier BA sends the time to D2 as text when the off time has been passed and is negative. So your trigger wouldn't play after 00:00:00. If you want to play in that time after the scheduled off time you can use the function ISTEXT($D$2) to check for negative times. So if you wanted your formula to check all the way up to the off time (when D2 may be negative and text) you could use

OR($D$2<=TIMEVALUE("00:00:30"),ISTEXT($D$2)) instead of $D$2<=TIMEVALUE("00:00:30")
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: Setting VBA using Time before a race starts.

Postby Captain Sensible » Tue Nov 09, 2021 7:36 pm

Your other option is stripping the start time out of A1 and using that in your formulas if you don't want to use ISTEXT(). No idea why Gruss sends it as text rather than a negative time but there must be some good reason.
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: Setting VBA using Time before a race starts.

Postby Sussexguy44 » Fri Nov 12, 2021 3:57 pm

Above two challenges sorted, thanks for all previous help.
Sussexguy44
 
Posts: 55
Joined: Thu Oct 14, 2021 9:43 am

Re: Setting VBA using Time before a race starts.

Postby Sussexguy44 » Mon Nov 22, 2021 7:27 pm

Hiya,
If WorksheetFunction.IsText(.Range("D2").Value) = False And (IsEmpty(Range("AA5").Value) Or WorksheetFunction.IsText(.Range("AA5").Value)) Then
If .Range("D2").Value <= TimeValue("00:10:00") Then
.Range("AA5:AA" & lastRow).Value = .Range("Z5:Z" & lastRow).Value

I have the above working well. I want to add an additional instruction

.Range("AM5:AM" & lastRow).Value = .Range("F5:F" & lastRow).Value

Essentially I am looking to copy the odds at 10 mins before the race over to a cell as a value. Im not sure about where I put the If and then words?
Sussexguy44
 
Posts: 55
Joined: Thu Oct 14, 2021 9:43 am

Re: Setting VBA using Time before a race starts.

Postby brumbie » Tue Nov 23, 2021 10:20 am

You don't. As it is the same time simply copy and paste that last line of formula underneath ie:

If WorksheetFunction.IsText(.Range("D2").Value) = False And (IsEmpty(Range("AA5").Value) Or WorksheetFunction.IsText(.Range("AA5").Value)) Then
If .Range("D2").Value <= TimeValue("00:10:00") Then
.Range("AA5:AA" & lastRow).Value = .Range("Z5:Z" & lastRow).Value
.Range("AM5:AM" & lastRow).Value = .Range("F5:F" & lastRow).Value
brumbie
 
Posts: 197
Joined: Tue Dec 28, 2010 2:00 am
Location: Brisbane,Australia

Re: Setting VBA using Time before a race starts.

Postby brumbie » Tue Nov 23, 2021 10:29 am

Also, further up the code under:
.Range("AA5:AA" & lastRow).ClearContents

also paste

.Range("AM5:AM" & lastRow).ClearContents
brumbie
 
Posts: 197
Joined: Tue Dec 28, 2010 2:00 am
Location: Brisbane,Australia

Re: Setting VBA using Time before a race starts.

Postby Sussexguy44 » Thu Nov 25, 2021 5:54 pm

Thanks for this, all working well.
Sussexguy44
 
Posts: 55
Joined: Thu Oct 14, 2021 9:43 am

Previous

Return to Discussion

Who is online

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