View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen Per Jessen is offline
external usenet poster
 
Posts: 1,533
Default Time Marcos on Weekday only

Hi

Use the code below to determine if the weekday fall into your criteria and
then use the OnTime statement:

Dim MyWeekDay As Long
MyWeekDay = Weekday(Date, FirstDayOfWeek:=vbMonday)
Select Case MyWeekDay
Case 1 To 5
'Monday to Friday
Application.OnTime TimeValue("08:00:00"), "MyMacro"
End Select

Hopes this helps.

---
Per

"Elton Law" skrev i meddelelsen
...
Dear Expert,

I asked a question 2 weeks ago.
How to set the time macro.
Some has replied me and asked me to check following path.
That is useful.

http://www.brainbell.com/tutorials/m...A_Set_Time.htm

But now, I want to set a time marco which only run on specified time on
weekday only.
May I know how to write in VBA please ?
Thanks so much.