Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Scheduled Macros in Excel
Is there a way to time an Excel Macro (that will copy data from a specified
row and paste data into another worksheet), 3 times daily?.,,, for example 11am, 1pm and 4pm. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Scheduled Macros in Excel
You can use OnTime, but this will only set the next scheduled time.
What you could do is check the time and set the next accordingly, something like Sub myProc() Dim nTime As Date If Time < TimeValue("11:00:00") Then nTime = TimeValue("11:00:00") ElseIf Time < TimeValue("13:00:00") Then nTime = TimeValue("13:00:00") ElseIf Time < TimeValue("16:00:00") Then nTime = TimeValue("16:00:00") Else nTime = 1 - Now() + TimeValue("11:00:00") End If Application.OnTime nTime, "myProc" End Sub and start the myProc off and running. -- HTH Bob Phillips "Kee" wrote in message ... Is there a way to time an Excel Macro (that will copy data from a specified row and paste data into another worksheet), 3 times daily?.,,, for example 11am, 1pm and 4pm. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run Excel macro from Scheduled Task | Excel Worksheet Functions | |||
Trying to run a MSQuery from Excel as a Scheduled Task | Excel Discussion (Misc queries) | |||
Scheduled data capture in Excel | Excel Worksheet Functions | |||
Excel macro's to run at a scheduled time | Excel Discussion (Misc queries) | |||
starting macros via scheduled tasks | Excel Programming |