Sheet A - love
Sheet B - free
The code works when only sheet "love" is protected. It does not work if I protect both sheets , I get a Run-time Error Code "1004" Unable to set the Hidden Property of the range class. I need to protect both sheets.
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Activate
If Not Application.Intersect(Range("A1"), Range(Target.Address)) Is Nothing Then
Me.Unprotect "blue"
Select Case Target.Value
Case Is = "yes": Sheets("free").Rows("3:5").EntireRow.Hidden = False
Sheets("free").Rows("7:8").EntireRow.Hidden = True
Case Is = "no": Sheets("free").Rows("7:8").EntireRow.Hidden = False
Sheets("free").Rows("3:5").EntireRow.Hidden = True
End Select
Me.Protect "blue"
End If
End Sub
I have successfully used "me.uprotect..." with other codes, but to hide rows on the same sheet not on a different sheet.
I new at this and learned what I know form YouTube.
Thanks
Sheet B - free
The code works when only sheet "love" is protected. It does not work if I protect both sheets , I get a Run-time Error Code "1004" Unable to set the Hidden Property of the range class. I need to protect both sheets.
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Activate
If Not Application.Intersect(Range("A1"), Range(Target.Address)) Is Nothing Then
Me.Unprotect "blue"
Select Case Target.Value
Case Is = "yes": Sheets("free").Rows("3:5").EntireRow.Hidden = False
Sheets("free").Rows("7:8").EntireRow.Hidden = True
Case Is = "no": Sheets("free").Rows("7:8").EntireRow.Hidden = False
Sheets("free").Rows("3:5").EntireRow.Hidden = True
End Select
Me.Protect "blue"
End If
End Sub
I have successfully used "me.uprotect..." with other codes, but to hide rows on the same sheet not on a different sheet.
I new at this and learned what I know form YouTube.
Thanks