Dependent Data Validation

S

Shacks

I have two drop down lists.
1. user selects Yes or No in cell A2
2. If user selects Yes then cell B2 allows user to select from a list of 4
items
3. If user selects No then cell B2 should be blank as the user does not
need to enter anymore information.
I was able to create the dependent drop down list if user selects Yes, but
not sure how to have the blank when user selects No.

Thanks!
 
S

Shacks

Thank you, but if the user selects yes and then chooses an item from the
list, but then changes their selection to No I would like the dependent list
to revert to blank.
 
F

FSt1

hi
validation doesn't exactly work that way. you will need something extra.
right click the sheet tab that contains your validation.
from the pop up, click view code.
paste this code into the code window.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range
Set r = Range("A2")
If Intersect(Target, r) Is Nothing Then
Exit Sub
Else
If r.Value = "no" Then
r.Offset(0, 1).Value = ""
End If
End If

End Sub

this will check if the selection has changed and if "no", clear B2.

Regards
FSt1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top