Hello,
I want to hide SheetB when the value of cell B2 in SheetA is not 0. Cell B2 in Sheet A is a formula.
I came with the following code that I put in sheetA's code, but it doesn't work, nothing happens. Could anyone help me?
Thank You,
Julien
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("B2")) Is Nothing Then
Sheets("SheetB").Select
With ActiveSheet
.Unprotect "password"
.Visible = (sheets("SheetA").Range("B2") = 0)
.EnableSelection = xlUnlockedCells
.Protect "password", True
End With
Sheets("SheetA").Select
End If
End Sub
Bookmarks