Hide column with locked cells

  • Thread starter Thread starter Robert H
  • Start date Start date
R

Robert H

I have a worksheed that a users input data useing data validation.
There are cloumns on the sheet that display data based on selections
made in adjacent columns. The cells in these 'display column" contain
formulas that I need to protect but I also want to enable the user to
hide the display column to decluter if they need to. As best I can
teel you cannot hide/unhide a column with locked cells. Is there a
method or work around to do this?
 
Sub hide_unhide()
ActiveSheet.Unprotect Password:="justme"
With Columns("C:E")
If .EntireColumn.Hidden = False Then
.EntireColumn.Hidden = True
Else: .EntireColumn.Hidden = False
End If
End With
ActiveSheet.Protect Password:="justme"
End Sub


Gord Dibben MS Excel MVP
 
Back
Top