Just started getting this error today after several weeks of trying to finish a workbook I inherited. I tried several additions from help I received previously from the Board, but can't figure it out.
Unable to set the Hidden property of the Range class
Private Sub Worksheet_Activate()
Call SalesHideCol
End Sub
Sub SalesHideCol()
Dim Rng As Range
Dim c As Range
' Adjust the range to suit
Me.Unprotect Password:="Hermes"
Application.ScreenUpdating = False
Set Rng = Range("G1:K1")
For Each c In Rng
' Determine Criteria
If c.Value = "H" Then
c.EntireColumn.Hidden = True
Else
c.EntireColumn.Hidden = False
End If
Me.Protect Password:="Hermes"
Application.ScreenUpdating = False
Next c
End Sub
When I click Debug, the c.EntireColumn.Hidden = False row is highlighted.
The changes I made today are protecting the individual sheets with my password. Any ideas?
Thanks, Jim
Unable to set the Hidden property of the Range class
Private Sub Worksheet_Activate()
Call SalesHideCol
End Sub
Sub SalesHideCol()
Dim Rng As Range
Dim c As Range
' Adjust the range to suit
Me.Unprotect Password:="Hermes"
Application.ScreenUpdating = False
Set Rng = Range("G1:K1")
For Each c In Rng
' Determine Criteria
If c.Value = "H" Then
c.EntireColumn.Hidden = True
Else
c.EntireColumn.Hidden = False
End If
Me.Protect Password:="Hermes"
Application.ScreenUpdating = False
Next c
End Sub
When I click Debug, the c.EntireColumn.Hidden = False row is highlighted.
The changes I made today are protecting the individual sheets with my password. Any ideas?
Thanks, Jim