Countdown timer - call macro?

Discussion regarding the spreadsheet functionality of Bet Angel.
Post Reply
LinusP
Posts: 1918
Joined: Mon Jul 02, 2012 10:45 pm

Hi,

I have managed to get a countdown timer running on my spreadsheet, I also have cells which change in value when the counter is below a certain value (using IF command) I now want to have a macro running off this change in value but I just can't get it to work.

Does anyone know what code I should be using?

Thanks
staker72
Posts: 55
Joined: Wed Feb 17, 2010 9:08 am

Hi Linus,
To the best of my knowledge it is not possible to trigger a macro from a change in value on a spreadsheet. If anyone has a way then that's a sort of holy grail.

Depending on exactly what you are trying to do the only way to sort of achieve the same result would be to use an IF statement in your macro to the effect of if cell equals x (you need to specify as a range) then do Y.

You would then need to write, either as a separate macro or within this one, an OnTime or OnChange subroutine so that either every refresh or every so many seconds the macro runs and therefore trigger if requisite condition met.

Regards
LinusP
Posts: 1918
Joined: Mon Jul 02, 2012 10:45 pm

I am working on it at the moment and almost have something that works off an "if" function cell....
6thSense
Bet Angel
Bet Angel
Posts: 375
Joined: Fri Nov 30, 2012 5:02 pm

Isn't this what you are after?

http://support.microsoft.com/kb/213612
LinusP
Posts: 1918
Joined: Mon Jul 02, 2012 10:45 pm

No it has to be a worksheet_calculate event as the user isn't inputting anything. I have got it to work but it just loops the macro causing my laptop to have a fit...
nigelk
Posts: 469
Joined: Wed Apr 15, 2009 11:00 pm

The worksheet calculate event works for the whole sheet, not just one cell.

Target the call you want and then disable events before running the macro, then turn them on again after it has run.

See if that helps.

Cheers,Nigel.
LinusP
Posts: 1918
Joined: Mon Jul 02, 2012 10:45 pm

Ahh, I have the disable / enable events code but I might have it in the wrong place. Will try tonight after work, cheers
nicrag9
Posts: 42
Joined: Sun May 16, 2010 8:02 am

Hi, You could certainly do it by using VBA. If you write the code into the Betangel sheet module, you could use the time countdown, and then have it perform any code you like.

Nic
Post Reply

Return to “Bet Angel - Spreadsheet / Excel chat”