Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default time specific macros

i was told about time specific macros if i want a report to run during the
night from my acd into excel then excel to grab the data and then into the
report for my managers is this the case because i cant find anything on the
this
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default time specific macros

Hi James,

As a start, see VBA help for the OnTime method.


---
Regards,
Norman



"dobson,james" wrote in message
...
i was told about time specific macros if i want a report to run during the
night from my acd into excel then excel to grab the data and then into the
report for my managers is this the case because i cant find anything on
the
this



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default time specific macros

hi,
here is code i use to set a macro to run a 5am weekdays only. the PC has to
be on for it to fire. i start the macro when i leave work each day at 5 pm.
there are 2 subs here. 1 is prelaunch and decide if it friday or not and
displays the appropriate message. the second sub takes over and sit on the
appropriate action until time to fire. it calls a third sub call macAStart
which is the main macro.

regards.
FSt1

Sub macAAPrelaunchMR()

Set LookDate = Range("A1")
If LookDate = Date Then
MsgBox ("The Morning Routine has been run today. Update not allowed
at this time.")
Exit Sub
Else
Range("B1").Select
Range(ActiveCell, ActiveCell.Offset(40, 5)).ClearContents
Range(ActiveCell, ActiveCell.Offset(40, 5)).Interior.ColorIndex
= Automatic
Selection.Font.ColorIndex = 0
Range("B3").Select

If Weekday(Now()) = 6 Then
ActiveCell.FormulaR1C1 = " This Macro will not start until
Monday Morning about 5:00am " & Date + 2.5
Else
ActiveCell.FormulaR1C1 = "This macro will not start until
5:00am " & Date + 1
ActiveCell.Offset(1, 0).Select
End If
End If
Range("B5").Select
Call macALaunchMR

End Sub
Sub macALaunchMR()

If Weekday(Now()) = 6 Then '1 = Sunday, 2 = Monday, 3 = Tuesday, ect
Application.OnTime Now() + 2.5 + TimeValue("00:00:03"), "macAStart"
Else
Application.OnTime TimeValue("05:00:00"), "macAStart"
End If

End Sub

"dobson,james" wrote:

i was told about time specific macros if i want a report to run during the
night from my acd into excel then excel to grab the data and then into the
report for my managers is this the case because i cant find anything on the
this

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
macros to insert specific rows without altering the formula Mysore Excel Discussion (Misc queries) 4 September 4th 07 05:04 PM
IF statement to calculate time usage in specific time bands Daren Excel Worksheet Functions 6 January 31st 07 01:34 PM
Determining a specific time during the day Susan Hayes Excel Worksheet Functions 2 September 9th 05 01:28 AM
Create macros to print specific cells Richy Excel Programming 3 February 17th 04 03:42 PM
time specific data Ron Albert Excel Programming 1 January 18th 04 11:55 AM


All times are GMT +1. The time now is 11:16 AM.

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

About Us

"It's about Microsoft Excel"