If you're interested the formula should have been as follows:
=if(and(B2="Y",E2="Perm"),D2="No")
JAF
Oops - Not Working. Still Need Help
That'll teach me to be so cocky.
That little Data Validation formula doesn't work in all circumstances.
Entries for the call are invalid if the formula returns a value of FALSE, but either cell can contain different values. What I want to do is to force a value of "No", but only when B2="Y" and E2="Perm"
Re: Oops - Not Working. Still Need Help
JAF,
I don't know how to do it with a formula but this is some code that will prompt the user that the entry is invalid and the proper entry is "No" and asks if they wish to accept that answer. If they click no it clears the cell and selects it for them to redo. Hope it does what you need. This goes in a worksheet module for whatever worksheet the cell is on. I have the code set to cell A1 for the answer NO. You need to change it to whatever cell it is that No goes in.
Ryan
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim VRange As Range
Set VRange = Range("A1") 'Change this to whatever cell you need
Application.ScreenUpdating = False
If Union(Target, VRange).Address = VRange.Address Then
Application.EnableEvents = False
If Range("B2").Value = "Y" And Range("E2").Value = "Perm" _
And Target.Value <> "No" Then
If MsgBox("The valid entry for this cell is 'No'. " & vbCrLf & _
"Do you want to accept this?", vbYesNo + vbCritical, "Invalid Entry") = vbYes Then
Target.Value = "No"
Else
Target.Value = ""
Target.Select
End If
End If
Application.EnableEvents = True
End If
Application.ScreenUpdating = True
End Sub
Re: Oops - Not Working. Still Need Help
JAF
You were 99% there. Try :-
=IF(AND(B2="Y",E2="Perm"),"No","")
Ada
Sorry. Didn't read your message properly.
I don't think the formula I gave can be used in Data Validation.
Ada
I think this one works(I hope) :-
=IF(AND(B2="Y",E2="Perm"),D2="No","D2")
Ada