I feel this should be pretty easy, but I can not get anything to happen when I run this code. No errors, its as if the If function isnt being triggered despite the correct value in the correct range being in place. If the word “Initial” is in range AA1, then I want all sheets with the word Interim in them to not be visible.
Dim sCellVal As String
sCellVal = Worksheets("Instructions").Range("AA1").Value
If sCellVal = "Initial" Then
Dim ws As Worksheet 'Use object instead of worksheet for Chartsheets
For Each ws In sheets
If InStr(ws.name, "Interim") Then
ws.Visible = False
End If
Next ws
End If