View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JLatham JLatham is offline
external usenet poster
 
Posts: 2,203
Default How to set macro to run every 15 minutes?

Stolen from a very nearby universe, er, answer to a question, and modified to
protect the guilty.

Option Explicit
Dim nextRunTime

Sub startRunning()
'you could put
' Run "MyCode"
'in the Workbook_Open() event
'
MyCode
End Sub

Sub stopRunning()
On Error Resume Next
Application.OnTime nextRunTime, "MyCode", , False
End Sub

Sub MyCode()
nextSecond = Now + TimeValue("00:15:00")
Application.OnTime nextSecond, "MyCode"

'your process to run right in with this stuff
'it has already set itself to run again in 15 minutes
End Sub


"Eric" wrote:

Does anyone have any suggestions on how to set macro to run every 15 minutes?
Thanks in advance for any suggestions
Eric