Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Time Marcos on Weekday only
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Time Marcos on Weekday only
Use Application.OnTime and set the time as below
Public dTime As Date Sub MyMacro() dTime = Now + TimeValue("00:15:00") Application.OnTime dTime, "MyMacro" End Sub http://www.ozgrid.com/Excel/run-macro-on-time.htm If this post helps click Yes --------------- Jacob Skaria "Elton Law" wrote: 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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Time Marcos on Weekday only
Hi
Use this to determine which weekday it is and then "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. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Time Marcos on Weekday only
Please refer the below link created by Chip Pearson at Pearson Software
Consulting, LLC http://www.cpearson.com/excel/ontime.aspx -- If this post helps click Yes --------------- Jacob Skaria "Elton Law" wrote: 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help on Marcos | Excel Discussion (Misc queries) | |||
Filtering out weekday dead time | Excel Worksheet Functions | |||
Weekday + Time Calculation in Cell | Excel Worksheet Functions | |||
WEEKDAY() function: display TEXT not numeric weekday | Excel Discussion (Misc queries) | |||
Marcos | Excel Worksheet Functions |