Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Validate date in Excel as weekday

I am trying to find a way to validate a date entered in Excel as a weekday.
It would be helpful to warn the user if they try to enter a Saturday or
Sunday date and possible holidays.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Validate date in Excel as weekday

Dim mydate As String
mydate = Format(Date + 2, "dddd")
If mydate = "Saturday" Then msgbox="Saturday Entered"
If mydate = "Sunday" Then msgbox = "Sunday Entered"

"TCUser" wrote:

I am trying to find a way to validate a date entered in Excel as a weekday.
It would be helpful to warn the user if they try to enter a Saturday or
Sunday date and possible holidays.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Validate date in Excel as weekday

you don't really give an example of what you're doing, but here is one way,
with the date entered in A1

If Weekday(Range("A1").Value, vbMonday) 5 Then
MsgBox "weekend"
End If

--


Gary

"TCUser" wrote in message
...
I am trying to find a way to validate a date entered in Excel as a weekday.
It would be helpful to warn the user if they try to enter a Saturday or
Sunday date and possible holidays.




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
How to compute date of next weekday? [email protected] Excel Discussion (Misc queries) 4 July 31st 08 02:05 AM
calculating weekday date Khardy3352 New Users to Excel 3 June 11th 08 11:27 AM
convert weekday date to the next sunday date Oldersox Excel Worksheet Functions 2 January 8th 07 11:26 AM
WEEKDAY() function: display TEXT not numeric weekday tom Excel Discussion (Misc queries) 3 November 21st 06 04:32 PM
Getting weekday for a date schoujar[_7_] Excel Programming 6 September 2nd 05 11:01 AM


All times are GMT +1. The time now is 09:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"