Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: group/ungroup protected sheets?

2,091 views
Skip to first unread message

Gord Dibben

unread,
Mar 25, 2010, 2:46:02 PM3/25/10
to
You must have the Data>Group and Outline area pre-set.

Then you add event code to the worksheet module.

Private Sub Worksheet_Activate()
With Me
.Protect Password:="justme", userinterfaceonly:=True
.EnableOutlining = True
End With
End Sub

This will allow showing and hiding detail on a protected sheet.


Gord Dibben MS Excel MVP

On Wed, 24 Mar 2010 12:41:01 -0700, RLD <R...@discussions.microsoft.com>
wrote:

>Is it possible to allow users to group & ungroup rows in a protected sheet?

brenelder

unread,
Sep 22, 2010, 7:06:31 AM9/22/10
to
Gord Dibben wrote on 03/25/2010 13:46 ET :
> You must have the Data&gt;Group and Outline area pre-set.

>
> Then you add event code to the worksheet module.
>
> Private Sub Worksheet_Activate()
> With Me
> .Protect Password:=&quot;justme&quot;, userinterfaceonly:=True

> .EnableOutlining = True
> End With
> End Sub
>
> This will allow showing and hiding detail on a protected sheet.
>
>
> Gord Dibben MS Excel MVP
>
> On Wed, 24 Mar 2010 12:41:01 -0700, RLD
> wrote:
>
>> Is it possible to allow users to group &amp; ungroup rows in a protected
>> sheet?
>>
>
Gord
I have very limited experience in visual basic and I am trying to create a
form
to distribute. Is there a way to run the code automatically when the file is
opened. I do not want the users to go into visual basic and run the code.
(unless there is something that i am missing, but that seems to be the only
way
i can get it to work).

Thanks
Brendan

Gord Dibben

unread,
Sep 22, 2010, 4:38:34 PM9/22/10
to
The code I posted is event code which runs when the specific worksheet is
activated by clicking on the sheet tab.

All the code does is allow changing G & O the sheet when sheet is selected.

All other protection remains in effect.

Right-click on the sheet tab and "View Code".

Copy/paste the code into that sheet module.

Alt + q to return to Excel.

Switch sheets forth and back to see results of code.


Gord

Jurgita

unread,
Sep 29, 2010, 8:44:31 AM9/29/10
to
Hi,

Found many suggestions how to enable grouping in protected sheet, but still doesn't work for me. Is it problem because I'm using Excel 2010? All it does - asks me to save file as xlsm mode and then still does nothing... Thank you for any advice.

Submitted via EggHeadCafe - Software Developer Portal of Choice
Why GUIDs are not a good idea for SQL Server Primary Keys
http://www.eggheadcafe.com/tutorials/aspnet/d662b371-ed27-481c-aee0-ebe7cf2d9fad/why-guids-are-not-a-good-idea-for-sql-server-primary-keys.aspx

0 new messages