group/ungroup protected sheets?

  • Thread starter Thread starter RLD
  • Start date Start date
You must have the Data>Group and Outline area pre-set.

Then you add event code to the worksheet module.

Private Sub Worksheet_Activate()
With Me
.Protect Password:="justme", userinterfaceonly:=True
.EnableOutlining = True
End With
End Sub

This will allow showing and hiding detail on a protected sheet.


Gord Dibben MS Excel MVP
 
The code I posted is event code which runs when the specific worksheet is
activated by clicking on the sheet tab.

All the code does is allow changing G & O the sheet when sheet is selected.

All other protection remains in effect.

Right-click on the sheet tab and "View Code".

Copy/paste the code into that sheet module.

Alt + q to return to Excel.

Switch sheets forth and back to see results of code.


Gord
 
Back
Top