View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Andy Andy is offline
external usenet poster
 
Posts: 414
Default Start/Repeat/Stop Macro at specific time/interval

Thanks Halim,
I am fairly new at VBA. What part of the code says to repeat the macro
every 15 secs? I might like to change this varible in the future. Thanks!

"Halim" wrote:

Hi,

Try this one, as your req. Place in standard module

Option Explicit
Dim add

Sub Scheduled()
Application.OnTime TimeValue("08:" & Format(add, "00") & ":00"),
"Procedure"
End Sub

Sub Procedure()
add = add + 1
If Format(Now, "m") = 3 Then End
Scheduled
End Sub

Sub test()
add = 1
Scheduled
End Sub


'Then run test

--
Regards,

Halim



"andy" wrote:

Hi All,
I have a macro that I would like to start at 8:30am and then repeat every 15
seconds, and stop at 3pm. I did look at cperson.com but I am unsure of how
to write this specifically. Thanks,