More then 2 conditions for Data Validation

Pauljj

Well-known Member
Joined
Mar 28, 2004
Messages
2,047
I have a quandry, I need one cell for users to put in a date. The date can only be between todays date and the 31/12/12...I have set this up in Data Validation, so all ok, however. I now also need a warning message to pop if the date they enter is not a Sunday date. It should still let them continue though if they want to, or give them the opportunity to retry. Does anyone know how I could incorporate them both please
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
I don't think you can do that with Data Validation...
It's purpose is to Allow or Dissallow certain values.
Not give the user the choice of using the value anyway...
At least not while preserving the Restriction of the Date Range...
If you set it to allow Sunday anyway, it would then also allow a date ouside your date range.

I would leave your validation as it is to restrict the date range.
But perhaps use Conditional Formatting to highlight the cell a certain color if it's on a Sunday..
 
Last edited:
Upvote 0
How about in another cell, say B1

=WEEKDAY(A1)

Then
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("A1")) Is Nothing Then
    If Range("B1") <> 1 Then
    Msgbox "Date entered is not a Sunday"
    End If
Else
    Exit Sub
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,534
Messages
6,179,390
Members
452,909
Latest member
VickiS

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