PC Review


Reply
Thread Tools Rate Thread

Allowing for Grouping and Ungrouping while Sheet is Protected

 
 
cardan
Guest
Posts: n/a
 
      13th Feb 2007
Hello all,

Is there a way to protect a worksheet but still allow for grouping and
ungrouping of of columns and/or rows. I already have the rows and
columns grouped, I just need to be able to expand and collapse them
while the sheet is protected. Any advice or help would be most
welcomed! Thank you.

 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      13th Feb 2007
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
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.)

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

cardan wrote:
>
> Hello all,
>
> Is there a way to protect a worksheet but still allow for grouping and
> ungrouping of of columns and/or rows. I already have the rows and
> columns grouped, I just need to be able to expand and collapse them
> while the sheet is protected. Any advice or help would be most
> welcomed! Thank you.


--

Dave Peterson
 
Reply With Quote
 
cardan
Guest
Posts: n/a
 
      14th Feb 2007
On Feb 13, 3:05 pm, Dave Peterson <peter...@verizonXSPAM.net> 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
> 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.)
>
> If you're new to macros, you may want to read David McRitchie's intro at:http://www.mvps.org/dmcritchie/excel/getstarted.htm
>
> cardan wrote:
>
> > Hello all,

>
> > Is there a way to protect a worksheet but still allow for grouping and
> > ungrouping of of columns and/or rows. I already have the rows and
> > columns grouped, I just need to be able to expand and collapse them
> > while the sheet is protected. Any advice or help would be most
> > welcomed! Thank you.

>
> --
>
> Dave Peterson


Great to know! Thanks for your help!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to protect sheet allowing grouping and ungrouping but alsoallowing changing colour of specific cells Anurag Kothari Microsoft Excel Misc 2 13th Oct 2009 02:29 PM
Allow grouping / ungrouping while protecting the sheet =?Utf-8?B?U2FjaGluIFZhaXNobmF2?= Microsoft Excel Programming 10 16th Apr 2006 12:21 AM
Allowing hyperlinks an a protected sheet =?Utf-8?B?Q2hyaXMgSW5jZQ==?= Microsoft Excel Misc 2 7th Nov 2005 08:25 PM
Ungrouping / grouping on a protected sheet Balsak Microsoft Excel Worksheet Functions 2 4th Oct 2004 05:43 PM
grouping and ungrouping a protected sheet Manjunath Microsoft Excel Worksheet Functions 0 10th Jul 2003 09:48 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:15 AM.