LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Setting timer to run macro at regular intervals

Hi,

You can us Ontime

This goes in the workbook open event module to kick things off

Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:01:00"), "MyMacro"
End Sub

and this goes in a general module

Public dTime As Date
Sub MyMacro()
dTime = Now + TimeValue("00:01:00")
Application.OnTime dTime, "MyMacro"

'Your code

End Sub

As written this runs MyMacro every 1 minute, change this to what you want

Mike

"sun" wrote:

Dear Excel Gurus,

Can I set a timer to run a macro at regular time intervals? Is there a
convenient API to use?

Thank you very much in advance.



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting timer to run macro at regular intervals Gord Dibben Excel Programming 0 January 10th 09 05:17 PM
how to insert a row at regular intervals of row dsnema Excel Programming 1 March 7th 08 11:57 PM
Inserting a Row Range at regular intervals [email protected] Excel Programming 1 April 3rd 07 05:58 PM
How to trigger a macro at regular intervals? ÉH Excel Programming 3 January 6th 06 09:10 PM
Timer which counting smaller than 1 second intervals Berend Botje[_37_] Excel Programming 6 November 19th 04 09:19 PM


All times are GMT +1. The time now is 04:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"