q2 excel help

Please post any questions regarding the program here.

Moderator: 2020vision

Postby andrej » Fri Aug 27, 2010 3:28 pm

but is does not make any sense because one you move to the next market there al "0"'s in X so the -1 should disapear at that moment
andrej
 
Posts: 42
Joined: Tue Aug 24, 2010 6:59 am
Location: SLOVAKIA

Postby andrej » Fri Aug 27, 2010 3:31 pm

Well, now it moved by just one market. I am having very slow connection to the internet at the moment and sometimes BA does not refresh like it should. can it be caused by this?
andrej
 
Posts: 42
Joined: Tue Aug 24, 2010 6:59 am
Location: SLOVAKIA

Postby osknows » Fri Aug 27, 2010 3:58 pm

perhaps..

how about this which removes the formula when forwarding the market then once the new market is loaded replaces the formula

Code: Select all
Dim lastrace As String
Dim nextracetrigger As Integer

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Columns.Count <> 16 Then Exit Sub
Application.EnableEvents = False

With ThisWorkbook.Sheets(Target.Worksheet.Name)

If .Range("e2").Value = -1 And nextracetrigger = 0 Then
.Range("e2").Value = ""
lastrace = .Range("A1").Value
.Range("Q2").Value = -1
nextracetrigger = 1

End If

If lastrace <> .Range("A1").Value Then
nextracetrigger = 0
.Range("e2").Formula = "=IF(AND(OR(X14>B3;X14="""");OR(X15>B3;X15="""");OR(X16>B3;X16="""");OR(X17>B3;X17="""");OR(X18>B3;X18="""");OR(X19>B3;X19="""");OR(X19>B3;X19="""");OR(X19>B3;X19="""");OR(X20>B3;X20="""");OR(X21>B3;X21="""");OR(X22>B3;X22="""");OR(X23>B3;X23="""");OR(X24>B3;X24="""");OR(X25>B3;X25="""");OR(X26>B3;X26="""");OR(X27>B3;X27="""");OR(X28>B3;X28="""");OR(X29>B3;X29="""");OR(X30>B3;X30=""""));-1;"""")"
End If

End With

Application.EnableEvents = True
End Sub
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby andrej » Fri Aug 27, 2010 4:39 pm

I have modified your code a bit to fit into my sheet because I have moved what e2 was into e4 and my q2 is at q11.

Dim lastrace As String
Dim nextracetrigger As Integer

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Columns.Count <> 16 Then Exit Sub
Application.EnableEvents = False

With ThisWorkbook.Sheets(Target.Worksheet.Name)

If .Range("e4").Value = -1 And nextracetrigger = 0 Then
.Range("e4").Value = ""
lastrace = .Range("A10").Value
.Range("Q11").Value = -1
nextracetrigger = 1

End If

If lastrace <> .Range("A1").Value Then
nextracetrigger = 0
.Range("e4").Formula = "=IF(AND(OR(X14>B3;X14="""");OR(X15>B3;X15="""");OR(X16>B3;X16="""");OR(X17>B3;X17="""");OR(X18>B3;X18="""");OR(X19>B3;X19="""");OR(X19>B3;X19="""");OR(X19>B3;X19="""");OR(X20>B3;X20="""");OR(X21>B3;X21="""");OR(X22>B3;X22="""");OR(X23>B3;X23="""");OR(X24>B3;X24="""");OR(X25>B3;X25="""");OR(X26>B3;X26="""");OR(X27>B3;X27="""");OR(X28>B3;X28="""");OR(X29>B3;X29="""");OR(X30>B3;X30=""""));-1;"""")"
End If

End With

Application.EnableEvents = True
End Sub


the problem is that it does not do anything at all. I must have done something wrong, but I do not know what.
andrej
 
Posts: 42
Joined: Tue Aug 24, 2010 6:59 am
Location: SLOVAKIA

Postby mak » Fri Aug 27, 2010 4:53 pm

If you placed the new code while BA it was logged in excel you should click on reset button in vba, or close excel & log again.
mak
 
Posts: 1086
Joined: Tue Jun 30, 2009 8:17 am

Postby osknows » Fri Aug 27, 2010 4:58 pm

If lastrace <> .Range("A10").Value Then
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby osknows » Fri Aug 27, 2010 5:04 pm

mak wrote:If you placed the new code while BA it was logged in excel you should click on reset button in vba, or close excel & log again.


If you've stopped the code after Application.EnableEvents = False then events will be disabled. Click view/Immediate window clear whatever is in there, paste 'Application.EnableEvents = true' and hit Enter to turn on events again
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby andrej » Fri Aug 27, 2010 5:31 pm

No, it still does nothing. Are my modifications correct?
andrej
 
Posts: 42
Joined: Tue Aug 24, 2010 6:59 am
Location: SLOVAKIA

Postby osknows » Fri Aug 27, 2010 5:54 pm

I can't see anything obvious. If your happy to PM a link to your spreadsheet I can take a look for you.
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby andrej » Mon Aug 30, 2010 12:11 pm

Hi again, the original E4 to Q11 is woring correctly, the problems I had must have been due to slow internet connection. Thanks for all help.
andrej
 
Posts: 42
Joined: Tue Aug 24, 2010 6:59 am
Location: SLOVAKIA

Delayed Races

Postby oxerife » Thu Sep 02, 2010 1:04 am

Hi everyone,

The code suggested by osknows is working perfectly but as I was watching the races cycling something unplanned happened: the current race was delayed almost 15 minutes. Then the next race was already over by the time the first race ended.

Any way to prevent this? I was thinking on adding another condition such as "if time after off >= 5mins" then "cycle to next market".

Suggestions?

Thanks
User avatar
oxerife
 
Posts: 20
Joined: Sat Aug 29, 2009 1:08 am

Postby osknows » Thu Sep 02, 2010 8:15 pm

Your suggestion of time after off > 5 mins sounds ok

Other options are:
Load each venue in different tabs
Select markets a set time before the off

I suppose it depends on your strategy and how important particular races are. For example, sometimes the time is caught up and the next race after the delay goes off on time, other times a decision is taken to delay every race by a set time which will impact all other races on the quickpick list.
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Previous

Return to Help

Who is online

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