Private Sub Worksheet_Change(ByVal Target As Range)
' Unlock workbook
ActiveWorkbook.Unprotect "Password"
ActiveSheet.Activate
If Not Application.Intersect(Range("B11"), Range(Target.Address)) Is Nothing Then
Select Case Target.Value
Case Is = "Yes/No": Rows("1:80").EntireRow.Hidden = False
Rows("7:18").EntireRow.Hidden = False
Case Is = "Yes": Rows("13").EntireRow.Hidden = True
Rows("12").EntireRow.Hidden = False
Case Is = "No": Rows("12").EntireRow.Hidden = True
Rows("13").EntireRow.Hidden = False
End Select
End If
' Lock Workbook
ActiveWorkbook.Protect "Password"
' Unlock Sheet
ActiveSheet.Unprotect "Passwordsheet"
ActiveSheet.Activate
If Not Application.Intersect(Range("B11"), Range(Target.Address)) Is Nothing Then
Select Case Target.Value
Case Is = "Yes/No": Rows("1:80").EntireRow.Hidden = False
Rows("7:18").EntireRow.Hidden = False
Case Is = "Yes": Rows("13").EntireRow.Hidden = True
Rows("12").EntireRow.Hidden = False
Case Is = "No": Rows("12").EntireRow.Hidden = True
Rows("13").EntireRow.Hidden = False
End Select
End If
' Lock Sheet
ActiveSheet.Protect "Passwordsheet"
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
' Unlock workbook
ActiveWorkbook.Unprotect "Password"
ActiveSheet.Activate
If Not Application.Intersect(Range("B11"), Range(Target.Address)) Is Nothing Then
Select Case Target.Value
Case Is = "Yes/No": Rows("1:80").EntireRow.Hidden = False
Rows("7:18").EntireRow.Hidden = False
Case Is = "Yes": Rows("13").EntireRow.Hidden = True
Rows("12").EntireRow.Hidden = False
Case Is = "No": Rows("12").EntireRow.Hidden = True
Rows("13").EntireRow.Hidden = False
End Select
End If
' Lock Workbook
ActiveWorkbook.Protect "Password"
' Unlock Sheet
ActiveSheet.Unprotect "Passwordsheet"
ActiveSheet.Activate
If Not Application.Intersect(Range("B11"), Range(Target.Address)) Is Nothing Then
Select Case Target.Value
Case Is = "Yes/No": Rows("1:80").EntireRow.Hidden = False
Rows("7:18").EntireRow.Hidden = False
Case Is = "Yes": Rows("13").EntireRow.Hidden = True
Rows("12").EntireRow.Hidden = False
Case Is = "No": Rows("12").EntireRow.Hidden = True
Rows("13").EntireRow.Hidden = False
End Select
End If
' Lock Sheet
ActiveSheet.Protect "Passwordsheet"
End Sub