Forum Discussion

EMBBerwyn's avatar
EMBBerwyn
Copper Contributor
Jun 08, 2022
Solved

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...
  • HansVogelaar's avatar
    Jun 08, 2022

    EMBBerwyn 

    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

Resources