Protected sheets and grouping

icudoc

New Member
Joined
Oct 30, 2002
Messages
8
I can't seem to find a way to open and close grouped cells if any of the cells concerned are grouped. Is there any way to protect formulas in grouped cells, but still be able to open and close the grouping?
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Do you mean merged cells?

Cell protection applies to both contents and formatting. You will need to unprotect the worksheet to unmerge the cells.
 
Upvote 0
No, I mean grouped rows or columns.. a function on the data menu. Viewing or hiding the grouped rows/columns does not work if any of the cells in those rows/columns are protected, even though no changes are made to any of the individual cells when using the button to view/hide the grouped cells.
 
Upvote 0
Sorry readers, I have just read my initial post and I have used the word grouped twice instead of using the word protected. My problem is this, I cannot use the group function on any rows or columns that contain protected cells, even though grouping and hiding/viewing the grouped cells does not actually change individual cells formatting or contents.
 
Upvote 0
Sorry, I misunderstood.

In VBA you can enable outlining on a protected sheet like this:

ActiveSheet.EnableOutlining = True
ActiveSheet.Protect contents:=True, userInterfaceOnly:=True

You cannot do this manually - you will have to unprotect the sheet.
 
Upvote 0
Thank you. I am not that familiar with VBA, how do I actually get that to run on a particular workbook (or sheet)
 
Upvote 0
Right click the Excel icon to the left of File on the menu and choose View Code. Paste this code into the window on the right:

Code:
Private Sub Workbook_Open()
'   *** Change name of sheet to suit ***
    With Worksheets("Sheet1")
        .EnableOutlining = True
        .Protect contents:=True, userInterfaceOnly:=True
    End With
End Sub

Press Alt+F11 to return to your worksheet and close the workbook, saving changes. Reopen the workbook and outlining should be possible.
 
Upvote 0
Hello,

Is there a way that I can do this for more than one sheet at the time. I have a huge workbook with about 30 sheets.

Thanks
 
Upvote 0

Forum statistics

Threads
1,214,379
Messages
6,119,190
Members
448,874
Latest member
Lancelots

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