ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Timer function (https://www.excelbanter.com/excel-programming/279756-timer-function.html)

Jan Kronsell[_3_]

Timer function
 
Hi NG!

I know I can use the OnTime function to make something happen at a given
time, or in a certain timeinterval, but is there anyway I can make something
happen in recurring intervals, like once every minute as long as the
spreadsheet is open - and still be able to use the sheet.

Jan



Chip Pearson

Timer function
 
Jan,

You can use OnTime to do this. See www.cpearson.com/excel/ontime.htm for
example code.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Jan Kronsell" wrote in message
...
Hi NG!

I know I can use the OnTime function to make something happen at a given
time, or in a certain timeinterval, but is there anyway I can make

something
happen in recurring intervals, like once every minute as long as the
spreadsheet is open - and still be able to use the sheet.

Jan





[email protected]

Timer function
 
Watch the linewrap. Place in the WorkBook_Open event,

Const dblOneMinute As Double = 0.00069444444444
Dim intA as Integer

For intA = 0 To 1200
Application.OnTime Now + (intA * dblOneMinute),
"YourProcedure"
Next intA

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------

Hi NG!

I know I can use the OnTime function to make something happen at a given
time, or in a certain timeinterval, but is there anyway I can make something
happen in recurring intervals, like once every minute as long as the
spreadsheet is open - and still be able to use the sheet.

Jan



Jan Kronsell[_3_]

Timer function
 
Thanks! Got it working now :-)

Jan

"Chip Pearson" skrev i en meddelelse
...
Jan,

You can use OnTime to do this. See www.cpearson.com/excel/ontime.htm for
example code.







All times are GMT +1. The time now is 05:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com