Group and Ungroup rows & sheet protection

A

Andre Croteau

Hello,
I am using Excel 2000

On a workbook, I have created a grouping of 2 rows showing a "+" sign in the
leftmost column.
However, when I protect the worksheet, and try to click on the plus sign, a
message comes up saying that I cannot use that command on a protected
worksheet.


I have another spreadsheet created months ago which permits this to be done.
That sheet is protected, yet I can unhide the rows by clicking on the "+"
sign

I am dumbfounded to understand why it does this on one spreadsheet and not
the other.

Any ideas?? Any help would be greatly appreciated.

André
 
D

Dave Peterson

If you already have the outline 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
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
 
A

Andre Croteau

Hi Dave,

Thanks for that, I didn't think to look for that.

In my second file, I do have an Auto_Open macro that permits the Outline.

André
 

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