Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet Deactivate
Are you thinking activesheet is the sheet you are coming from or the one you
are going to? -- HTH RP (remove nothere from the email address if mailing direct) "Graham Haughs" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet Deactivate
Bob Phillips wrote:
Are you thinking activesheet is the sheet you are coming from or the one you are going to? The activesheet is the one I am leaving. Graham |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet Deactivate
If you use the Workbook_SheetDeactivate workbook event, sh gives you the
sheet you are leaving. -- HTH Bob Phillips "Graham Haughs" wrote in message ... Bob Phillips wrote: Are you thinking activesheet is the sheet you are coming from or the one you are going to? The activesheet is the one I am leaving. Graham |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet Deactivate
Bob Phillips wrote:
If you use the Workbook_SheetDeactivate workbook event, sh gives you the sheet you are leaving. Thanks for that Bob Graham |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
pivot chart causes worksheet to deactivate | Excel Discussion (Misc queries) | |||
Deactivate worksheet | Excel Discussion (Misc queries) | |||
deactivate fullscreen | Excel Programming | |||
Deactivate autofill | Excel Programming | |||
Delete Worksheet on DeActivate | Excel Programming |