Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vba to determine day of week?

Status
Not open for further replies.
Dec 13, 2002
109
GB
Hi

I would like to make sure an event is NOT executed on Saturday or Sunday. How can I determine if today is a Saturday or Sunday. It seems you can only determine day is 1-31.

Cheers

Ronald
 
Ronald - the function to use here is the WEEKDAY function which will return a value of 1-7
May I suggest that you have a look in the excel help file as a lot of the questions you have asked recently can be found very easily within there Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
Use Weekday function:

[tt]If Weekday(Now(),vbMonday)<6 Then
Msgbox &quot;Working day!&quot;
End If[/tt]

combo
 
Thanks combo and geoff,

Geoff I did look in the help on this one. Unfortunately searches on &quot;day&quot;, &quot;date&quot; and &quot;week&quot; did not offer up this function..

Ronald
 
but a search on weekday would have ;-) Rgds
Geoff
&quot;Some cause happiness wherever they go; others whenever they go.&quot;
-Oscar Wilde
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top