Collapse/Expand groupings when sheet is locked

antaeusguy

Board Regular
Joined
Mar 8, 2010
Messages
81
I've created a form which has locked cells & unlocked cells. Unlocked cells are those fields which are intended for end users to fill in data.

All other cells are locked to prevent users from amending the formulas.

I've grouped some rows (e.g. row 2 to row 4). When I lock the sheet (only option is to select unlocked cells), I couldn't collapse/expand the groupings.

Because row 2 to row 4 contains formulas that I wouldn't allow end users to amend, I can't make these rows as unlocked. Even thou I unlocked it, I still can't collapse/expand...

Is there any other way to solve this issue? appreciate your help :)
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
To allow Grouping under a Protected Worksheet, it must be done each time the workbook is opened, so Workbook_Open event code is the place to do it.
Put code similar to this in the ThisWorkbook Module
Code:
Private Sub Workbook_Open()
    With worksheets("yoursheetname")
        .Unprotect "password"
        .EnableOutlining = True
        .Protect "password", contents:=True, userInterfaceOnly:=True
    End With
End Sub
Change "password" and "worksheet name" as needed.
 
Upvote 0

Forum statistics

Threads
1,224,505
Messages
6,179,153
Members
452,891
Latest member
JUSTOUTOFMYREACH

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