Hi
first code will populate the USA question based on the California question
2nd code will check if 1st question has been answered first
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("A2:A15"), Target) Is Nothing Then
If Target.Value = "Yes" Then ' california
Target.Offset(0, 1).Value = "Yes" 'USA
Else
Target.Offset(0, 1).Value = "No" 'USA
End If
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Application.Intersect(Range("B2:B15"), Target) Is Nothing Then
If Target.Offset(0, -1) = "" Then
MsgBox "Answer California question first"
Target.Value = ""
Target.Offset(0, -1).Activate
End If
End If
If Not Application.Intersect(Range("B2:B15"), Target) Is Nothing Then
If Target.Offset(0, -1) = "Yes" Then
Target.Value = "Yes"
End If
End If
End Sub
Bookmarks