View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Graham Haughs Graham Haughs is offline
external usenet poster
 
Posts: 49
Default Worksheet Deactivate

I am trying to enter code in a worksheet so that when I move to another
worksheet, several columns are hidden in the original worksheet, so that
when I return to it they are hidden. This is the code I am using but
keep getting a de-bug message.

Private Sub Worksheet_Deactivate()
ActiveSheet.Unprotect
Columns("O:Z").EntireColumn.Hidden = True
ActiveSheet.Protect
End Sub

I am sure it probably has something to do with the term Activesheet but
I don't know how to get round it.
I would appreciate any help.

Kind Regards
Graham Haughs
Turriff, Scotland