• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

how can i make it so that my macro called calc_effective runs each 2 mins.

BobBridges

Active Member
Probably not what you want, but if you're willing to use Windows' task scheduler then you can convert your macro to VBScript and have the scheduler run that program at any interval you like. At least, I assume you can; I haven't yet used it.

If by "every two minutes" you mean you're planning to sit watching it, leaving Excel open, then, let's see.... Oops, I can't open your attachment to see what you're doing; it wants me to log on to my MS account, which I never do. Interesting, I've never seen that requirement before. But it shouldn't be hard to use the Timer function to accomplish this, with a little experimentation.
 
Probably not what you want, but if you're willing to use Windows' task scheduler then you can convert your macro to VBScript and have the scheduler run that program at any interval you like. At least, I assume you can; I haven't yet used it.

If by "every two minutes" you mean you're planning to sit watching it, leaving Excel open, then, let's see.... Oops, I can't open your attachment to see what you're doing; it wants me to log on to my MS account, which I never do. Interesting, I've never seen that requirement before. But it shouldn't be hard to use the Timer function to accomplish this, with a little experimentation.
Please if you can try on my excel thanks
 

p45cal

Well-Known Member
In the attached:
Button at cell Y3 of the Testing_Master_Sheet sheet whose caption changes
Code in Module1:
Module-wide variables declared at the top of the module
Suggested alternative codes for your calc_effective sub. I've used calc_effective3
Additional subs to control updating.
For testing, the updating is every 10 seconds, change the "00:00:10" in
NextSchedule = Now() + TimeValue("00:00:10")
to
"00:02:00"
for two minutes.
 

Attachments

In the attached:
Button at cell Y3 of the Testing_Master_Sheet sheet whose caption changes
Code in Module1:
Module-wide variables declared at the top of the module
Suggested alternative codes for your calc_effective sub. I've used calc_effective3
Additional subs to control updating.
For testing, the updating is every 10 seconds, change the "00:00:10" in
NextSchedule = Now() + TimeValue("00:00:10")
to
"00:02:00"
for two minutes.
thanks - are you able to make it so that we can automatically have the macro run when the file is open and then each 20 secs after that - without the user having to press start stop.
I understand that you need to add a ' call the routine' in the worksheet VBA - but did not work for me.

thanks
 

Marc L

Excel Ninja
As post #12 demonstration uses the same specific code than post #9 to launch a procedure every five seconds …​
 
Top