Protection & Grouping

0

0013

Is there any way to protect a sheet, but still allow people to group and
ungroup rows and columns?

Thanks,
 
F

Frank Kabel

Hi
depending on your Excel version (I think starting in 2003) you can set
these option in the protection dialog
 
0

0013

Sorry, forgot to mention that I was talking about in 2003.

Even when I check all of the check boxes in the sheet protection dialog, I
still get an error.

Any ideas? Even if it's through VBA?
 
D

Dave Peterson

I use xl2002 and there's an option to "use Autofilter"--but nothing for
grouping.

You can protect the worksheet in code:

But this setting isn't remembered between closing/reopening the workbook. (So
Auto_open is a nice spot for it.)

Option Explicit
Sub auto_open()

Dim wks As Worksheet
Set wks = Worksheets("sheet1")

With wks
.Protect Password:="hi", userinterfaceonly:=True
.EnableAutoFilter = True
'or
.EnableOutlining = True
End With

End Sub

EnableAutofilter/enableoutlining--depending on what you mean by grouped.

And autofilter or the outlining has to be applied beforehand.
 
A

ALK

Super info! This solved the problem for me and works well with other macro
code. Thanks Dave.
 
Top