Group Function on a Protected Worksheet

  • Thread starter Thread starter CiaraG
  • Start date Start date
C

CiaraG

Someone asked the question a number of weeks ago as to how
to view grouped rows on a protected worksheet.

A number of people replied by advising to enter VB buttons
on the worksheet. Is there no way of allowing grouped
rows to be automatically viewed by using VB code on the
worksheet???? In the same way that a filter can still be
enabled on a protected worksheet.

I have a number of grouped rows on my worksheet that I
would like the user to be able to view, if they wish.

All ideas would be appreciated.

Rgs,

CG

P.s. Happy Christmas!!!
 
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
 
Back
Top