Excel-Grouping with protection of worksheet?

  • Thread starter Thread starter BC Manjunath
  • Start date Start date
B

BC Manjunath

Hello Can EXcel gurus help me,
After grouping i have protected the sheet. So that user(s)
should not modifiy the contents but should be able to read.
protection of sheet protects the grouping also. As a
result user fails to click the + or _ button og the groups
or switch between the levels (by clicking levels at the
top left corner).

Is there a way to have a protected sheet + with switching
between grouping allowed?
Thanks,
bc
 
If you protect the sheet in code (auto_open/workbook_open??), you can allow
this:

Option Explicit
Sub auto_open()
With Worksheets("sheet1")
.Protect Password:="hi", userinterfaceonly:=True
.EnableOutlining = True
End With
End Sub

It needs to be reset each time you open the workbook. (excel doesn't remember
it after closing the workbook.)

(you could use the workbook_open even under ThisWorkbook, too.)

Don't forget to lock the VBA Project, too. Else you'll have inquisitive types
looking at your code and seeing the password.

Inside the VBE, you can lock the project.
Tools|VBAProject Properties|Protection tab.
Give it a memorable password and lock the project for viewing.

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