LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default Check to see if date is = to Sunday

Brian, here is one way,

Sub test()
If Weekday(Range("A1"), vbSunday) = 1 Then
'*****if its a Sunday
MsgBox "this is a Sunday"
Else
'*****If not a Sunday
MsgBox "this is Not a Sunday"
End If
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"Brian" wrote in message
ups.com...
I want to prompt the user if the date he entered is not a Sunday. It
might not be the Sunday in the current week but any Sunday. Is this
possible in VBA?


Thanks in advance

Brian



 
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
convert weekday date to the next sunday date Oldersox Excel Worksheet Functions 2 January 8th 07 11:26 AM
Check to see if date is = to Sunday Brian Excel Programming 1 June 19th 06 03:22 AM
Check to see if date is = to Sunday Brian Excel Programming 0 June 19th 06 02:53 AM
Date Command to Get the Sunday Before the First of the Month Minitman Excel Worksheet Functions 6 December 2nd 05 09:34 PM
adding day (sunday, Monday) to date RickyDee Excel Worksheet Functions 4 September 10th 05 07:14 PM


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

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"