Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autorun a macro at preset times
I have a macro that draws data from a website and places in to several tables
which are then organised is different criteria. Instead of me manually hitting the button with assigned macro, I want to have the macro run itself every 10 minutes. How do I do this please? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autorun a macro at preset times
Darren,
have a look at ONTIME in Excel VBA help -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "Darren" wrote: I have a macro that draws data from a website and places in to several tables which are then organised is different criteria. Instead of me manually hitting the button with assigned macro, I want to have the macro run itself every 10 minutes. How do I do this please? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autorun a macro at preset times
You can use this line of code:
Sub YourSub() ' your code here Application.OnTime Now + TimeValue("00:10:00"), "YourSub" End Sub I would also suggest you reading Chip Pearson's site about the OnTime Event. Hope this helps! If so, let me know, click "YES" below. http://www.cpearson.com/Excel/OnTime.aspx -- Cheers, Ryan "Darren" wrote: I have a macro that draws data from a website and places in to several tables which are then organised is different criteria. Instead of me manually hitting the button with assigned macro, I want to have the macro run itself every 10 minutes. How do I do this please? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autorun a macro at preset times
Hi Mike, I did as you suggested and this is what I come up with:
Sub Autorun() ' ' Autorun Macro ' ' Application.OnTime Now + TimeValue("00:10:00"), "Refresh" End Sub Unfortunately it only repeats once. How to I make it repeat itself at the stated time intervals i.e. every 10 minutes? "Mike H" wrote: Darren, have a look at ONTIME in Excel VBA help -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "Darren" wrote: I have a macro that draws data from a website and places in to several tables which are then organised is different criteria. Instead of me manually hitting the button with assigned macro, I want to have the macro run itself every 10 minutes. How do I do this please? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autorun a macro at preset times
You are telling the OnTime Event to run a macro named "Refresh" you want to
re-run "Autorun". Try this line below or see my reply to your original post. Hope this helps! If so, let me know click "YES" below. Application.OnTime Now + TimeValue("00:10:00"), "Autorun" -- Cheers, Ryan "Darren" wrote: Hi Mike, I did as you suggested and this is what I come up with: Sub Autorun() ' ' Autorun Macro ' ' Application.OnTime Now + TimeValue("00:10:00"), "Refresh" End Sub Unfortunately it only repeats once. How to I make it repeat itself at the stated time intervals i.e. every 10 minutes? "Mike H" wrote: Darren, have a look at ONTIME in Excel VBA help -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "Darren" wrote: I have a macro that draws data from a website and places in to several tables which are then organised is different criteria. Instead of me manually hitting the button with assigned macro, I want to have the macro run itself every 10 minutes. How do I do this please? |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autorun a macro at preset times
Thankyou.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Autorun macro does not autorun... | Excel Programming | |||
Autorun macro | Excel Discussion (Misc queries) | |||
AutoRun Macro with a delay to give user the choice to cancel the macro | Excel Programming | |||
Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet | Excel Programming | |||
autorun a macro | Excel Programming |