Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In a large workbook with a number of worksheets, some worksheets have certain
columns hidden or grouped and normally viewed at level 1. Also, some worksheets have code that runs on sheet activation and/or de-activation, and if I move from one of those to a worksheet containing the grouping it is ungrouped, whereas moving to it from other worksheets doesn't cause the problem and it remains as saved. Any ideas please? Also, can someone please explain the difference (if there is any) between Activate/De-Activate and Open/Close when writing code related to Events. -- pignick |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Having had no replies to my initial question, can I explain it in a bit more
detail to see if that helps. When I move from the worksheet containing the following code to another worksheet the columns A:DO are selected in that sheet, and I am trying to understand why this happens as I thought that "End Sub" stopped the code. Private Sub WorkSheet_DeActivate() ActiveSheet.Unprotect ActiveSheet.Columns("A:DO").Select Selection.EntireColumn.Hidden = False ActiveSheet.Protect End Sub I think the same thing must be happening when I move from the sheet containing that code to another sheet containing some grouped columns that normally display at level 1, and these get ungrouped (even though the sheet is protected) presumably because the instruction to unprotect and then unhide the columns is being given. No doubt the answer to this is simple and I'm overlooking it, but any help would be welcome. -- pignick "pignick" wrote: In a large workbook with a number of worksheets, some worksheets have certain columns hidden or grouped and normally viewed at level 1. Also, some worksheets have code that runs on sheet activation and/or de-activation, and if I move from one of those to a worksheet containing the grouping it is ungrouped, whereas moving to it from other worksheets doesn't cause the problem and it remains as saved. Any ideas please? Also, can someone please explain the difference (if there is any) between Activate/De-Activate and Open/Close when writing code related to Events. -- pignick |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try using
application.enableevents = false at the beginning of your coding and application.enableevents = true at the end. this will stop your events from triggering other events, which is what i believe you are describing. hope that helps! :) susan On May 27, 6:03*am, pignick wrote: Having had no replies to my initial question, can I explain it in a bit more detail to see if that helps. When I move from the worksheet containing the following code to another worksheet the columns A:DO are selected in that sheet, and I am trying to understand why this happens as I thought that "End Sub" stopped the code. Private Sub WorkSheet_DeActivate() ActiveSheet.Unprotect ActiveSheet.Columns("A:DO").Select Selection.EntireColumn.Hidden = False ActiveSheet.Protect End Sub I think the same thing must be happening when I move from the sheet containing that code to another sheet containing some grouped columns that normally display at level 1, and these get ungrouped (even though the sheet is protected) presumably because the instruction to unprotect and then unhide the columns is being given. No doubt the answer to this is simple and I'm overlooking it, but any help would be welcome. -- pignick "pignick" wrote: In a large workbook with a number of worksheets, some worksheets have certain columns hidden or grouped and normally viewed at level 1. *Also, some worksheets have code that runs on sheet activation and/or de-activation, and if I move from one of those to a worksheet containing the grouping it is ungrouped, whereas moving to it from other worksheets doesn't cause the problem and it remains as saved. * Any ideas please? * Also, can someone please explain the difference (if there is any) between Activate/De-Activate and Open/Close when writing code related to Events.. -- pignick- Hide quoted text - - Show quoted text - |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Susan, but I don't think that has fully resolved the problem. I am
out of the office now for a few days but will take another look and try again. In the meantime if anyone else has any suggestions please post them. -- pignick "Susan" wrote: try using application.enableevents = false at the beginning of your coding and application.enableevents = true at the end. this will stop your events from triggering other events, which is what i believe you are describing. hope that helps! :) susan On May 27, 6:03 am, pignick wrote: Having had no replies to my initial question, can I explain it in a bit more detail to see if that helps. When I move from the worksheet containing the following code to another worksheet the columns A:DO are selected in that sheet, and I am trying to understand why this happens as I thought that "End Sub" stopped the code. Private Sub WorkSheet_DeActivate() ActiveSheet.Unprotect ActiveSheet.Columns("A:DO").Select Selection.EntireColumn.Hidden = False ActiveSheet.Protect End Sub I think the same thing must be happening when I move from the sheet containing that code to another sheet containing some grouped columns that normally display at level 1, and these get ungrouped (even though the sheet is protected) presumably because the instruction to unprotect and then unhide the columns is being given. No doubt the answer to this is simple and I'm overlooking it, but any help would be welcome. -- pignick "pignick" wrote: In a large workbook with a number of worksheets, some worksheets have certain columns hidden or grouped and normally viewed at level 1. Also, some worksheets have code that runs on sheet activation and/or de-activation, and if I move from one of those to a worksheet containing the grouping it is ungrouped, whereas moving to it from other worksheets doesn't cause the problem and it remains as saved. Any ideas please? Also, can someone please explain the difference (if there is any) between Activate/De-Activate and Open/Close when writing code related to Events.. -- pignick- Hide quoted text - - Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Standard chart types over-ridden by user-defined 'default' | Charts and Charting in Excel | |||
IDENTIFY CELLS WHERE FORMULA WAS OVER-RIDDEN | Excel Programming | |||
When hiding column error messge"Can'nt shift object off sheet" | Excel Discussion (Misc queries) | |||
My Excel Sheet has opened as a mirror image - Column A is on the . | Setting up and Configuration of Excel | |||
Grouping and Hiding of columns functionality | Excel Programming |