Hi,
I have an excel sheet, where I have beow code to hode a range of rows based on the cell valude in cell F50, however the code is not working and giving error if the sheet is protected.
Pls help to edit the below code to work in protected sheet with password
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("F50"), Range(Target.Address)) Is Nothing Then
Select Case Target.Value
Case Is = "Select": Rows("51:59").EntireRow.Hidden = True
Case Is = "No": Rows("51:59").EntireRow.Hidden = True
Case Is = "Yes": Rows("51:59").EntireRow.Hidden = False
End Select
End If
End Sub
I have an excel sheet, where I have beow code to hode a range of rows based on the cell valude in cell F50, however the code is not working and giving error if the sheet is protected.
Pls help to edit the below code to work in protected sheet with password
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("F50"), Range(Target.Address)) Is Nothing Then
Select Case Target.Value
Case Is = "Select": Rows("51:59").EntireRow.Hidden = True
Case Is = "No": Rows("51:59").EntireRow.Hidden = True
Case Is = "Yes": Rows("51:59").EntireRow.Hidden = False
End Select
End If
End Sub