Hello,
I have a simple work book.
In B1, the data is limited (by Data Validation with a drop down List) to Yes and No.
I need to limit the range of data in D1 as, If A1 = Yes , then the value of D1 could be entered More or Equal to 51 ; and if A1 = No then the data entered into D1 should be Less than or Equals to 50
I prefer to do it with Data Validation. Anyone please help.
Configuration: Windows XP Firefox 3.0.13
I wondear wheher any quantitative condtion can be sued in validation.
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address <> "$B$1" Then Exit Sub If Target = "" Then Exit Sub If Target.Offset(0, -1) = "yes" And Target < 51 Then MsgBox "you should enter a number more than or equel to 51" Target.Clear End If If Target.Offset(0, -1) = "no" And Target > 50 Then MsgBox "you should enter number less than or equal to 50" Target.Clear End If End Sub now choose "yes" in A1 and type in B1 some number less than 51 see what happens. similarly choose "no" for A1 and type in B1 some number more than 50 what happens if the correct number is entered nothing will happen. try. |