Put this in the "Planning" worksheet module:
Option Explicit
Const wsPassWord = "ADMIN"
Private Sub Worksheet_Change(ByVal Target As Range)
Dim xRng As Range
Set xRng = Range("B3:H12") 'adjust to suit - this should be the range of cells which may contain 'x', and which worksheets Mon-Sun link to.
If Not Intersect(Target, xRng) Is Nothing Then
Call HideRows
End If
End Sub
Private Sub HideRows()
Dim c As Range, sWS As Variant
Dim vbHideRange As Boolean
Application.ScreenUpdating = False
For Each sWS In Array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")
With Worksheets(sWS)
.Unprotect wsPassWord
For Each c In .Range("C10,C23,C36, C49, C62, C75, C88, C101, C114, C127")
If c.Value = "x" Then
vbHideRange = True
Else
vbHideRange = False
End If
c.Offset(-1, 0).Resize(13, 1).EntireRow.Hidden = vbHideRange
Next c
.Protect wsPassWord
End With
Next sWS
Application.ScreenUpdating = True
End Sub
Bookmarks