Forum Discussion
EMBBerwyn
Jun 08, 2022Copper Contributor
Resetting data validation questions to the default of blank.
I'm creating a health questionnaire for students some of whom are veterans. I've created a little form to help identify their health insurance coverage and next of kin. A copy of which has been uploa...
- Jun 08, 2022
Use this:
Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Range("B2"), Target) Is Nothing Then If Range("B2").Value <> "Yes" Then Application.EnableEvents = False Range("B6:D6,B8,B9,B11,B14").ClearContents Application.EnableEvents = True End If End If If Not Intersect(Range("B8"), Target) Is Nothing Then If Range("B8").Value <> "Yes" Then Application.EnableEvents = False Range("B9").ClearContents Application.EnableEvents = True End If End If End Sub
HansVogelaar
Jun 08, 2022MVP
Use this:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Range("B2"), Target) Is Nothing Then
If Range("B2").Value <> "Yes" Then
Application.EnableEvents = False
Range("B6:D6,B8,B9,B11,B14").ClearContents
Application.EnableEvents = True
End If
End If
If Not Intersect(Range("B8"), Target) Is Nothing Then
If Range("B8").Value <> "Yes" Then
Application.EnableEvents = False
Range("B9").ClearContents
Application.EnableEvents = True
End If
End If
End SubEMBBerwyn
Jun 08, 2022Copper Contributor
Hans,
Thank you for such a prompt response to my question. I've tested your VBA code several times seems to work perfectly. Thank you very much.
Ed
Thank you for such a prompt response to my question. I've tested your VBA code several times seems to work perfectly. Thank you very much.
Ed