Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 182
Default Start/Repeat/Stop Macro at specific time/interval

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,

  #2   Report Post  
Posted to microsoft.public.excel.programming
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,

Reply
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
Stop time - start time calculation squack21 Excel Worksheet Functions 5 December 10th 07 03:20 PM
Start & Stop Time button Andy Excel Programming 8 March 28th 07 01:20 PM
repeat macro after time interval MikeM Excel Programming 1 March 18th 07 09:33 AM
Formula to find Stop Time from Start Time and Total Minutes Jonathan Bickett Excel Worksheet Functions 5 March 7th 07 05:22 PM
how to have a module to repeat itself at a certain time interval? Radionise Excel Programming 2 April 14th 04 08:10 AM


All times are GMT +1. The time now is 08:52 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"