![]() |
Check date upon input
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 |
Check date upon input
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) -- Regards, OssieMac "Rob" wrote: 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 |
Check date upon input
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. -- Regards, OssieMac "OssieMac" wrote: 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) -- Regards, OssieMac "Rob" wrote: 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 |
Check date upon input
Thanks OssieMac, done the job required. I have been on the wrong track of
looking to code in VBA. Thanks again, Rob "OssieMac" wrote in message ... 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) -- Regards, OssieMac "Rob" wrote: 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 |
All times are GMT +1. The time now is 07:10 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com