Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Help!!! I have a protected worksheet which I share with managers. I've
included groupings which I want the managers to expand or collapse, but they can't because the worksheet is protected. What can I do to allow collapsing and expanding groups on a protected worksheet. thanks -- vince m |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
If you already have the outline/subtotals/autofilter applied, you can protect
the worksheet in code (auto_open/workbook_open??). Option Explicit Sub auto_open() With Worksheets("sheet1") .Protect Password:="hi", userinterfaceonly:=True .EnableOutlining = True .EnableAutoFilter = True 'If .FilterMode Then ' .ShowAllData 'End If End With End Sub It needs to be reset each time you open the workbook. (Earlier versions of excel don't remember it after closing the workbook. IIRC, xl2002+ will remember the allow autofilter setting under tools|Protection|protect sheet, but that won't help when you're filtering via code.) ====== I wasn't sure how you created the groupings--data|group or data|filter|autofilter. You probably won't need both the .enableoutlining and ..enableautofilter. Delete/comment the one you don't want. If you used data|filter|autofilter and want to make sure that all the data is visible, you may want to uncomment those if/then/end if lines. vince @ west electric group wrote: Help!!! I have a protected worksheet which I share with managers. I've included groupings which I want the managers to expand or collapse, but they can't because the worksheet is protected. What can I do to allow collapsing and expanding groups on a protected worksheet. thanks -- vince m -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Dave, can you give me line by line instructions on how and where to apply
your solution? Also, do I need to re-establish your solution every time the worksheet is used in excel 2003? Thanks -- vince m "Dave Peterson" wrote: If you already have the outline/subtotals/autofilter applied, you can protect the worksheet in code (auto_open/workbook_open??). Option Explicit Sub auto_open() With Worksheets("sheet1") .Protect Password:="hi", userinterfaceonly:=True .EnableOutlining = True .EnableAutoFilter = True 'If .FilterMode Then ' .ShowAllData 'End If End With End Sub It needs to be reset each time you open the workbook. (Earlier versions of excel don't remember it after closing the workbook. IIRC, xl2002+ will remember the allow autofilter setting under tools|Protection|protect sheet, but that won't help when you're filtering via code.) ====== I wasn't sure how you created the groupings--data|group or data|filter|autofilter. You probably won't need both the .enableoutlining and ..enableautofilter. Delete/comment the one you don't want. If you used data|filter|autofilter and want to make sure that all the data is visible, you may want to uncomment those if/then/end if lines. vince @ west electric group wrote: Help!!! I have a protected worksheet which I share with managers. I've included groupings which I want the managers to expand or collapse, but they can't because the worksheet is protected. What can I do to allow collapsing and expanding groups on a protected worksheet. thanks -- vince m -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Yes, you need to have this code run each time the workbook is opened.
By naming the routing Auto_Open and putting it in a General module, excel will run this code automatically--well, if the user allows macros to run! Open excel Open your workbook Hit alt-f11 to get to the VBE where that code will be located. Hit ctrl-r to see the project explorer (like windows explorer) Select your project--you should see the workbook's name in parentheses. Insert|Module Paste that code in the code window that just opened. Make sure that you change the sheet name and the password to what you need. Hit alt-f11 to get back to excel. Save your file Close the file Reopen the file Answer yes to allow macros (if prompted) Did it work? vince @ west electric group wrote: Dave, can you give me line by line instructions on how and where to apply your solution? Also, do I need to re-establish your solution every time the worksheet is used in excel 2003? Thanks -- vince m "Dave Peterson" wrote: If you already have the outline/subtotals/autofilter applied, you can protect the worksheet in code (auto_open/workbook_open??). Option Explicit Sub auto_open() With Worksheets("sheet1") .Protect Password:="hi", userinterfaceonly:=True .EnableOutlining = True .EnableAutoFilter = True 'If .FilterMode Then ' .ShowAllData 'End If End With End Sub It needs to be reset each time you open the workbook. (Earlier versions of excel don't remember it after closing the workbook. IIRC, xl2002+ will remember the allow autofilter setting under tools|Protection|protect sheet, but that won't help when you're filtering via code.) ====== I wasn't sure how you created the groupings--data|group or data|filter|autofilter. You probably won't need both the .enableoutlining and ..enableautofilter. Delete/comment the one you don't want. If you used data|filter|autofilter and want to make sure that all the data is visible, you may want to uncomment those if/then/end if lines. vince @ west electric group wrote: Help!!! I have a protected worksheet which I share with managers. I've included groupings which I want the managers to expand or collapse, but they can't because the worksheet is protected. What can I do to allow collapsing and expanding groups on a protected worksheet. thanks -- vince m -- Dave Peterson -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Not sure if this solution worked for the original person that posted the questions, but it worked wonderfully for me. Thank you very much Dave.
|
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I'm not sure which Dave posted the response that worked for you, but I'm sure
all Dave's will join me in saying: Glad it worked for you! <vbg Dore, Atkinson wrote: Not sure if this solution worked for the original person that posted the questions, but it worked wonderfully for me. Thank you very much Dave. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Expanding and Collapsing Groups within a Protected Workbook | Excel Worksheet Functions | |||
Expanding / Collapsing rows | Excel Discussion (Misc queries) | |||
Expanding and Collapsing | Excel Discussion (Misc queries) | |||
Expanding and collapsing rows | Excel Discussion (Misc queries) | |||
Expanding/Collapsing Rows? | Excel Worksheet Functions |