TIME instructions in Excel

Questions about integrating Excel and Cymatic, programming, formulae, etc

TIME instructions in Excel

Postby RoB » Tue Jan 10, 2017 12:35 pm

Hi,

What Excel functions instructions would be necessary to instruct a bet to be made when the live Cymatic sheet shows COUNTDOWN cell B4 to be -ve (i.e. after the scheduled start time) but INPLAY status cell E4 is FALSE?(race is not yet off).

Currently, I cannot get it to work with a negative COUNTDOWN timer: I use $B$4<TIME(0,0,5) to fire a bet when there is less than 5 secs to the scheduled off time. The aim is to stretch this to say, 10 seconds after the stated race time start (but when still not In Play).

My VBA knowledge is limited btw.

Cheers,
Rob
RoB
 
Posts: 49
Joined: Sun Aug 14, 2016 6:42 am

Re: TIME instructions in Excel

Postby Cym27 » Tue Jan 10, 2017 3:43 pm

Hi Rob.

Cell B4 (Countdown) is a bit of an oddity. When the value is positive and not estimated (no ? at the end), the value of the cell is a decimal number representing the time. If the value is negative or estimated, then it acts more like a string, so you can't use the TIME function in these circumstances. So you have to use string functions.

In your Private Sub Worksheet_Calculate() section of VBA put:
Code: Select all
If Left(Range("B4"), 1) = "-" And Range("E4") = False Then
        If Mid(Range("B4"), 2, 2) = 0 And Mid(Range("B4"), 5, 2) = 0 And Mid(Range("B4"), 8, 2) < 10 Then
        'Place your Bet command here
    End If
End If


If you want to get round Cymatic's estimated time in B4 you can always compare the current time with the scheduled off time in cell A4.

Hope this helps.

Steve.
Cym27
 
Posts: 149
Joined: Sun Jul 19, 2015 9:47 pm

Re: TIME instructions in Excel

Postby RoB » Tue Jan 10, 2017 5:47 pm

Steve,

Firstly, I appreciate your reply - I will get stuck into utilising this coding. I had a feeling that something strange was going on behind the COUNTDOWN timer.

Overall, my long term project of gaining a basic functional working knowledge of VBA is creeeeping along, so this will be a tester of quite where I've progressed to.

Onwards and upwards ...

Thanks again,
Rob
RoB
 
Posts: 49
Joined: Sun Aug 14, 2016 6:42 am


Return to Excel - Help / Support

Who is online

Users browsing this forum: No registered users and 0 guests

cron