Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 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
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
Help on Marcos abc[_2_] Excel Discussion (Misc queries) 0 May 25th 10 08:14 AM
Filtering out weekday dead time Tony Clarke Excel Worksheet Functions 7 March 6th 09 10:44 PM
Weekday + Time Calculation in Cell Alexander Excel Worksheet Functions 7 January 9th 07 03:28 PM
WEEKDAY() function: display TEXT not numeric weekday tom Excel Discussion (Misc queries) 3 November 21st 06 04:32 PM
Marcos cjloneranger Excel Worksheet Functions 1 August 9th 05 03:39 PM


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

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"