Help with Refresh Macro

Please post any questions regarding the program here.

Moderator: 2020vision

Help with Refresh Macro

Postby Chisp » Wed Jan 05, 2011 2:52 pm

Hi, hoping someone can help me please. In excel I run three workbooks each with two worksheets. The three workbooks are connected to different Betfair accounts.

I'd really appreciate some help in creating a macro that will set the refresh for each tab. The refresh rate should be time dependent, so for example, I can set it at 4 at 2am.

Thanks in advance.
Chisp
 
Posts: 19
Joined: Tue Nov 11, 2008 8:53 pm

Postby alrodopial » Wed Jan 05, 2011 4:35 pm

Instead of a macro will a formula in cell Q2 do the job?
alrodopial
 
Posts: 1384
Joined: Wed Dec 06, 2006 9:59 pm

Postby Chisp » Wed Jan 05, 2011 9:19 pm

No, because when -3 is entered the formula gets overwritten.
Chisp
 
Posts: 19
Joined: Tue Nov 11, 2008 8:53 pm

Postby osknows » Wed Jan 05, 2011 9:38 pm

This code below is an example which forwards the markets using -1 in cell Q2 once a race is ended. It also tracks closed markets and updates balance using -6. Once the market has forwarded the formula is replaced which sets my refresh rate.

You can use the same principle to write -3 when needed then replace the Q2 formula for refresh rates.

Code: Select all
    'forward quick pick race on after race ended quick
    If fullstrArray(2, 5) = "In Play" And fullstrArray(2, 6) = "Suspended" And UCase(fullstrArray(1, 17)) = "Y" And nextracetrigger = 0 Then
        nextracetrigger = 1
        lastrace = fullstrArray(1, 1)
        ThisWorkbook.Sheets(Target.Worksheet.Name).Range("Q2").Value = -1

    ElseIf fullstrArray(2, 6) = "Closed" And UCase(fullstrArray(1, 17)) = "Y" And nextracetrigger = 0 Then
        nextracetrigger = 1
        lastrace = fullstrArray(1, 1)
        ThisWorkbook.Sheets(Target.Worksheet.Name).Range("Q2").Value = -1

    ElseIf fullstrArray(2, 6) = "Closed" And UCase(fullstrArray(1, 17)) = "Y" And nextracetrigger = 1 Then
        nextracetrigger = 2
        ThisWorkbook.Sheets(Target.Worksheet.Name).Range("Q2").Value = -6

    ElseIf fullstrArray(2, 6) = "Closed" And UCase(fullstrArray(1, 17)) = "Y" And nextracetrigger = 2 Then
        nextracetrigger = 3
        ThisWorkbook.Sheets(Target.Worksheet.Name).Range("Q2").Value = closedmarketrefresh
       
       
    ElseIf fullstrArray(2, 6) = "Closed" And UCase(fullstrArray(1, 17)) = "Y" And nextracetrigger = 3 Then
        nextracetrigger = 1
        ThisWorkbook.Sheets(Target.Worksheet.Name).Range("Q2").Value = -1
       
    End If

    If lastrace <> fullstrArray(1, 1) Then
        nextracetrigger = 0
        ThisWorkbook.Sheets(Target.Worksheet.Name).Range("Q2").Formula = "=IF(AND(E2=""In Play"",OR(F2=""Suspended"",F2=""Closed""))," & normalrefresh & ",IF(ISERROR(IF(AND(HOUR(D2)=0,MINUTE(D2)<=1)," & inplayrefresh & "," & normalrefresh & "))," & inplayrefresh & ",IF(AND(HOUR(D2)=0,MINUTE(D2)<=1)," & inplayrefresh & "," & normalrefresh & ")))"
       
    End If
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am


Return to Help

Who is online

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

cron