Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
auto run a macro
Hi,
I want to run a macro inMS excel, in specific time intervals automatically. I need to update my data and calculations in every five minutes for that I am using formulas and macros. Will it be possible to run a macro automaically, like auto refresh facility in MS excel. Thanks Garima |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
auto run a macro
Garima,
Use the OnTime method to schedule a macro. The following code (from Bill Manville, originally) shows how to repeat the same code every ten seconds: Dim NextTime As Date Sub DoItRepeatedly() DoItAgain End Sub Sub DoItAgain() DoIt ' this is your procedure NextTime = Now + TimeValue("00:00:10") ' 10 seconds on Application.OnTime NextTime, "DoItAgain" End Sub Sub StopDoingIt() Application.OnTime NextTime, "DoItAgain", schedule:=False End Sub Sub Auto_Close() ' otherwise it will re-open and do it again! StopDoingIt End Sub -- John Green - Excel MVP Sydney Australia "garima agrawal" wrote in message ... Hi, I want to run a macro inMS excel, in specific time intervals automatically. I need to update my data and calculations in every five minutes for that I am using formulas and macros. Will it be possible to run a macro automaically, like auto refresh facility in MS excel. Thanks Garima |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
auto run a macro
Chong/Garima
Have a look at Chip Pearsons's Ontime page http://www.cpearson.com/excel/ontime.htm Neil "Chong Moua" wrote in message ... Hi Garima, I don't know of an easy way to set macros to run every five minutes. What could work is to use the events feature. Everytime a particular cell or sheet changes then the macro runs. Hope this helps... Chong Moua -----Original Message----- Hi, I want to run a macro inMS excel, in specific time intervals automatically. I need to update my data and calculations in every five minutes for that I am using formulas and macros. Will it be possible to run a macro automaically, like auto refresh facility in MS excel. Thanks Garima . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Auto Run Macro | Excel Discussion (Misc queries) | |||
Sub Macro vrs Function Macro Auto Start | Excel Discussion (Misc queries) | |||
Run Auto Macro only once | Excel Worksheet Functions | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Auto Run a Macro | Excel Discussion (Misc queries) |