Allow users to use Group/Ungroup in protected sheet VBA Code Help

sthompson07

New Member
Joined
May 8, 2018
Messages
1
I have three sheets that are protected and all have grouped areas. I need my users to be able to use these features while the sheet is protected. I found this VBA code online and turned the workbook from .xlsx to .xlsm. Works perfect for sheet 1, how to i add in the ability for sheet 2 and 3.

I should I add I do not right VBA and have no experience, but I can google. just can't find this answer.


Private Sub Workbook_Open()
With Worksheets("Sheet 1")
.EnableOutlining = True
.Protect UserInterfaceOnly:=True
End With

End Sub


Thank you
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top