Setting validation on day in a date field

stevey03

New Member
Joined
Nov 28, 2003
Messages
25
Hi

I want a table to validate a field so that any date it returns cannot be a saturday or a sunday.

I really am stuck on how to dod this. The tableis a table about loaned books, and the field is date due back. I have already set this to default as 1 calender month after the date borrowed using Dateadd("m",1,Now()) but don't know how i could create a validation that works.

Hope someone can help/advise, I would be very grateful, :rolleyes:

Forgot to mention that the field displays the date as dd/mm/yyyy followed by time if you click it to modify it
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
This is kind of crude, but you could replace your default value of
  • =DateAdd("m",1,Now())
with:
  • =DateAdd("m",1,Now())+IIf(Weekday(DateAdd("m",1,Now()),2)=6,2,IIf(Weekday(DateAdd("m",1,Now()),2)=7,1,0))
However, if you are not entering dates directly into the table (so if you're using a form), then I might use a custom function to handle the date.

Hope this helps,

Russell
 
Upvote 0
Thats done it. Thank you very much I really needed to get that sorted. I was thinking along the lines of a validation rule but thats better.

Thanks again!
 
Upvote 0

Forum statistics

Threads
1,221,586
Messages
6,160,645
Members
451,661
Latest member
hamdan17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top