Using Group/Ungroup in protected worksheets

Linus_99

Board Regular
Joined
Aug 28, 2002
Messages
145
Hello,

I'm trying to protect a worksheet so that cells are protected but users can still group & ungroup sub-totals by using the Group/Ungroup symbols that appear at the margins.

When using the Protect command, I can't see a way to allow this to happen.

Does anyone know how this can be done for Excel 2003/2007 ?

Thanks
 
Hi Guys, I've being trying to use this macro on two worksheets also but it will only work on one of them.
Does anyone know where I'm going wrong?


Code:
Private Sub Workbook_Open()
With Worksheets("Custom_Components")
       .Protect Password:="", Userinterfaceonly:=True
       .EnableOutlining = True
       End With

With Worksheets("Std_Components")
       .Protect Password:="", Userinterfaceonly:=True
       .EnableOutlining = True       
       End With
End Sub
 
Upvote 0

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Are you sure they both have no password? Is there any other code that might be protecting one of the sheets?
 
Upvote 0
Hi Rory, thanks for the quick reply.

I closed the excel file and opened it again.
That seemed to work for me.
 
Upvote 0
That code is designed to run whenever you open the file. If you hadn't previously had it in when you opened the file, or run it manually, it would not have had any effect. ;)
 
Upvote 0
Hi Tracy,

I am not very well versed with advanced excel and I am struggling with protecting workbooks while still allowing other users to group/ ungroup in the office. Could you give me a step by step guide to do this for a dummy?

I tried the above solution, but I am definitely missing out on something because it doesn't seem to be working and my understanding of the programming language is not the best.

Thanks
S
 
Upvote 0
This doesn't seem to be working for me. I'm using it correctly.. but soon as i protect the worksheet it doesn't let me close or open via "+" "-" which is what i wanted.. or if it does work on a previous one i tried.. it would work until i close the workbook and reopen, then i have to re-enable the macro and protect the sheet again.

Just need it to be able to be closed and opened even on a protected work sheet.. whether it gets closed and reopened again!? :|
 
Upvote 0
You have to run the code each time the workbook opens - that's why it's in a Workbook_Open event.
 
Upvote 0
Why is it annoying? You don't have to do anything.
 
Upvote 0
Because this is for a place where i work, and many of the people that will be using this workbook wont know how to do it.. so that's why its annoying. A colleague at work had it working exactly how i'd like.. on 1997-2003 excel. he had it password protected and it was automatically enabled every time you open the worksheet. Didn't have a chance to ask him before he left tho.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,647
Messages
6,120,722
Members
448,987
Latest member
marion_davis

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