Link to home
Start Free TrialLog in
Avatar of David
DavidFlag for United States of America

asked on

Add the following into the VBA code below. If B6=Yes, then J32;J33=NA.

I would like to add the following into the VBA code below.  If B6=Yes, then J32;J33=NA.  The below code works but I don't want to screw it up.  Any help is appreciated!



If Target.CountLarge > 1 Then Exit Sub
On Error GoTo Skip
Application.EnableEvents = False
If Not Intersect(Target, Range("J19:J21")) Is Nothing Then
    Select Case Target.Address(0, 0)
        Case "J19"
            If Target = "Select" Then
                Range("J20:J21").Value = "Select"
            ElseIf Target = "No" Then
                Range("J20:J21").Value = "NA"
                Range("J37:J41").Value = "NA"
            ElseIf Target = "Yes" Then
                Range("J20:J21").Value = "Select"
                Range("J37:J41").Value = "Select"
            End If
        Case "J20", "J21"
            If Target = "" Or Range("J19") = "No" Then
                Range("J19:J21").Value = "Select"
            End If
    End Select
ElseIf Not Intersect(Target, Range("J22:J24")) Is Nothing Then
    Select Case Target.Address(0, 0)
        Case "J22"
            If Target = "Select" Then
                Range("J23:J24").Value = "Select"
            ElseIf Target = "No" Then
                Range("J23:J24").Value = "NA"
            ElseIf Target = "Yes" Then
                Range("J23:J24").Value = "Select"
                Range("J37:J41").Value = "Select"
            End If
        Case "J23", "J24"
            If Target = "" Or Range("J22") = "No" Then
                Range("J22:J24").Value = "Select"
            End If
    End Select
End If
Skip:
Application.EnableEvents = True
End Sub
ASKER CERTIFIED SOLUTION
Avatar of Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj)
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of David

ASKER

Thank you again!
You're welcome! :)