Check date upon input

R

Rob

Good morning,

Excel 2000. I want to trap upon entry into a cell (B4) whether a user has
correctly entered a Sunday date, the date also needs to be between two dates
that are in the spreadsheet (cell A1 start date and cell B2 end date). I
can check the latter part using Data Validation but not whether it is a
Sunday. Guessing that I need to add some VBA code but not too sure where to
start.

Any help welcome.

Thanks, Rob
 
O

OssieMac

Hi Rob,

I don't have xl2000 to test this but try the following formula for data
validation.

=AND(B4>=A1,B4<=A2,WEEKDAY(B4,1)=1)
 
O

OssieMac

My apologies Rob,

I used A1 and A2 as start and end dates instead of A1 an B2 as per your
question.
Try this instead.
=AND(B4>=A1,B4<=B2,WEEKDAY(B4,1)=1)

In later versions of xl in Data validation you select Custom and insert the
formula.
 
R

Rob

Thanks OssieMac, done the job required. I have been on the wrong track of
looking to code in VBA.

Thanks again, Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top