Worksheet Protection

M

mellowe

HI All

I have a worksheet that has some grouped cells that I would like to
user to be able to expand and collapse and edit when the worksheet is
protected but I can seem to find how to do this.

In my macro I have set up to unlock and lock the worksheet and certain
cells when I need it,and it has the conditions of the protection set up
e.g AllowFilters, AllowSorting but I cant see how to Allow the expand /
collapse / edit of the grouped cells! My grouped range is F12:G40

Please help as I have spent ages trying to find this! Thnx
 
D

Dave Peterson

If you already have the outline/subtotals 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. (excel doesn't remember
it after closing the workbook.)

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

mellowe

First thanks for the speedy repsonse Dave!
Thanks for the info will be able to apply this now Great !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top