Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

E#$nable Group/Ungroup in protected sheet I have an excel sheet which is renamed

ID: 3560633 • Letter: E

Question

E#$nable Group/Ungroup in protected sheet

I have an excel sheet which is renamed as "Emp Summary" which is protected without password.

In this protected sheet, I want to enable the Group/Ungroup option to show/hide row no. 34 to 42.

How to do that? Will macro must be require? If yes, then please write the code for me. I would appreciate if this could be done withouth a macro,

even by other trick/option.

Also, if I send the same file to another user, will he/she also requires to enable macro at his/her end?

Please help.

Explanation / Answer

^*&#56You need VBA for this, and the end user will need to allow macros for this to work.

Press Alt+F11 to activate the Visual Basic Editor.

Double-click ThisWorkbook, under Microsoft Excel Objects in the project explorer on the left hand side.

Copy the following code into the module that appears:

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

This code will be executed automatically each time the workbook is opened.