Hello. I need help figuring out why this code isn't working. I'm trying to write code that will hide any column that has "hide" in its respective row 1 (on all worksheets). When this code is initiated, it works for the first/active sheet but doesn't hide columns on any other sheets. Thank you for your help.
Sub Hide_Columns()
Application.ScreenUpdating = False
Dim c As Range
For Each Worksheet In Worksheets
On Error Resume Next
For Each c In Range("1:1")
c.EntireColumn.Hidden = (c.Value = "Hide")
Next c
Next Worksheet
Application.ScreenUpdating = True
Set c = Nothing
End Sub
Sub Hide_Columns()
Application.ScreenUpdating = False
Dim c As Range
For Each Worksheet In Worksheets
On Error Resume Next
For Each c In Range("1:1")
c.EntireColumn.Hidden = (c.Value = "Hide")
Next c
Next Worksheet
Application.ScreenUpdating = True
Set c = Nothing
End Sub