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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If Conditional Expression based on day of week

Status
Not open for further replies.

meagain

MIS
Nov 27, 2001
112
0
0
CA
Hi,

We're looking for an If conditional expression to enter in a macro, to run an action based on whether it is a weekday other than Monday.

Thank you,
Lori
 
You may want to explore VBA Weekday Function and add to your macro some logic like:

Code:
MsgBox Weekday(Date())
MsgBox WeekdayName(Weekday(Date()))

Select Case Weekday(Date())
    Case 1, 2, 7     [green]'Sun, Mon, Sat
  [/green]  
    Case Else   [green]'All other days[/green]

End Select


---- Andy

There is a great need for a sarcasm font.
 
Hi,

Thanks for your response.

I went with [green]If Weekday(Date())<>2 Then[/green] ...

It works great :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top