Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Kee Kee is offline
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default 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
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
Run Excel macro from Scheduled Task coolthinking Excel Worksheet Functions 4 July 13th 09 03:35 PM
Trying to run a MSQuery from Excel as a Scheduled Task Doug Excel Discussion (Misc queries) 1 March 6th 09 06:01 PM
Scheduled data capture in Excel jc132568 Excel Worksheet Functions 3 March 5th 08 02:59 AM
Excel macro's to run at a scheduled time Pramod Kamath Excel Discussion (Misc queries) 1 August 15th 06 02:04 PM
starting macros via scheduled tasks mnichols Excel Programming 1 May 24th 04 09:37 AM


All times are GMT +1. The time now is 06:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"