View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Run an Excel code every 15 minutes of the clock

Private mdtNextOnTime as Date

Dim d as Date
d = Now
mdtNextOnTime = Int(d) + TimeSerial(Hour(d), (Minute(d) \ 15 + 1) * 15, 0)

Regards,
Peter T

"thomas" wrote in message
...
Right now I have a routine based on CPearson's OnTime running on my Excel.
But it does not really meet my requirement. It runs every 15 minutes of
the
clock only if I start Excel before 8 am. If I start my Excel at 10:07, the
module will run at 10:22 followed by 10:37, etc.

I need my Excel module to run at every 15 minutes of the clock. If I start
my excel at 10:07, I want the module to fire up initially at 10.15
followed
by 10.30, 10.45, etc.

My knowledge of excel programming is rather basic.