clock in excel

Please post any questions regarding the program here.

Moderator: 2020vision

clock in excel

Postby cryfortheclown » Sun Sep 17, 2017 6:17 am

Hi there,
I was just wondering if there's any way to display the actual in-running time of a race once the race turns in-play on the excel sheet.
Thank you
cryfortheclown
 
Posts: 6
Joined: Sun Sep 17, 2017 5:55 am

Re: clock in excel

Postby Captain Sensible » Sun Sep 17, 2017 11:56 am

You'll need to use VBA as I don't think it can be done with formulas, just log the time the market indicator switches to "In Play" and then take the difference between that and the current time.
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: clock in excel

Postby cryfortheclown » Sun Sep 17, 2017 1:40 pm

Thanks for reply, - and how would I go about doing that, Captain? To be honest I don't know anything about VBA
cryfortheclown
 
Posts: 6
Joined: Sun Sep 17, 2017 5:55 am

Re: clock in excel

Postby Captain Sensible » Sun Sep 17, 2017 2:22 pm

VBA isn't any harder than formulas once you get started have a look at this thread to understand how to enter the code viewtopic.php?f=5&t=9800#p50270

Then enter the following code under sheet1 or whatever you called your sheet that get updates from Gruss. It can be stripped down a lot but it'll future proof you if you start getting more complicated code later on. It simply looks for E2 to display In play then timestamps the current time in cell AA1 (format that as time or it'll show 0.02222 or similar ) It'll then put the number of seconds the race has run in cell AA2 and stops when the race suspends showing the full duration. Once you enter a new market it'll clear the cells.

Code: Select all
    Option Explicit


    Private Sub Worksheet_Change(ByVal Target As Range)
    Static MyMarket As Variant
    On Error GoTo xit
    If Target.Columns.Count <> 16 Then Exit Sub
    Application.EnableEvents = False 'turns off events so we don't retrigger the code
    Application.Calculation = xlCalculationManual 'turns off all calculations

With Target.Parent

If .Range("A1").Value <> MyMarket Then ' setup any market parameters or clear old cells
MyMarket = .Range("A1").Value
.Range("AA1:AA2").Value = "" 'clear the timer for a new market
GoTo xit
End If
   
If .Range("E2").Value = "In Play" And .Range("AA1").Value = "" Then .Range("AA1").Value = .Range("C2").Value  'timestamp the off time'
If .Range("E2").Value = "In Play" And .Range("F2").Value = "" Then .Range("AA2").Value = DateDiff("s", .Range("AA1").Value, .Range("C2").Value)



End With

xit:
    Application.EnableEvents = True ' events back on
    Application.Calculation = xlCalculationAutomatic ' calculations back on
    End Sub
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: clock in excel

Postby alrodopial » Sun Sep 17, 2017 4:21 pm

another idea using formulas is something like the below:
viewtopic.php?f=3&t=932
alrodopial
 
Posts: 1355
Joined: Wed Dec 06, 2006 9:59 pm

Re: clock in excel

Postby Captain Sensible » Sun Sep 17, 2017 5:13 pm

alrodopial wrote:another idea using formulas is something like the below:
http://www.gruss-software.co.uk/forum/v ... ?f=3&t=932


alrodopial's method is probably the way to go so you can avoid VBA
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: clock in excel

Postby cryfortheclown » Sun Sep 17, 2017 9:39 pm

Brilliant thanks so much Captain S. & alrodopial
cryfortheclown
 
Posts: 6
Joined: Sun Sep 17, 2017 5:55 am


Return to Help

Who is online

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