Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default expanding or collapsing groupings in protected worksheets

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default expanding or collapsing groupings in protected worksheets

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default expanding or collapsing groupings in protected worksheets

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default expanding or collapsing groupings in protected worksheets

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default expanding or collapsing groupings in protectedworksheets

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default expanding or collapsing groupings in protectedworksheets

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Expanding and Collapsing Groups within a Protected Workbook blue Excel Worksheet Functions 1 January 17th 07 02:50 PM
Expanding / Collapsing rows GreenMonster Excel Discussion (Misc queries) 3 November 2nd 06 09:32 PM
Expanding and Collapsing QPapillon Excel Discussion (Misc queries) 2 March 31st 06 09:41 PM
Expanding and collapsing rows Eduardo Excel Discussion (Misc queries) 3 July 13th 05 02:12 PM
Expanding/Collapsing Rows? Jake Excel Worksheet Functions 2 March 27th 05 07:35 PM


All times are GMT +1. The time now is 03:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"