Hi, this is a continuation of thread68-1250213: Use Group and Outline in Excel with Protection On, where the VBA code was explained to allow the grouping/ungrouping of outlined columns/cells within a protected worksheet.
I have followed (uncorrectly, I guess) the directions given and I am not able to get the macros to work.
I am using Excel 2003 SP2.
This is what I would like to do:
Protect worksheet "Lookup Tool".
Allow users to change the values in Cells A10 and A34.
Allow users to open and close the +/- grouping buttons.
Allow users to format columns to remove #####'s when a result value is too large.
I entered the following code in the Sheet1 (Lookup Tool) module within Visual Basic Editor:
I have locked the entire worksheet sans A10 and A34.
The protection boxes that I checked are:
Select locked cells
Select unlocked cells
Format cells
Format columns
Format rows
Insert columns
When I open the file I am prompted to Enable macros, which I do. I can change cells A10 and A34. However, when I try to Close the open groups columns BCD and FGH by clicking on the "-" button, Excel screams at me with "You cannot use this command...."
What am I doing wrong?
Thanks,
Mike
“Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.”-Albert Einstein
I have followed (uncorrectly, I guess) the directions given and I am not able to get the macros to work.
I am using Excel 2003 SP2.
This is what I would like to do:
Protect worksheet "Lookup Tool".
Allow users to change the values in Cells A10 and A34.
Allow users to open and close the +/- grouping buttons.
Allow users to format columns to remove #####'s when a result value is too large.
I entered the following code in the Sheet1 (Lookup Tool) module within Visual Basic Editor:
Code:
Option Explicit
Sub auto_open()
With Worksheets("Sheet1")
.Protect Password:="lookup", userinterfaceonly:=True
.EnableOutlining = True
End With
End Sub
Sub Protect_Sheet()
ActiveSheet.EnableOutlining = True
ActiveSheet.Protect contents:=True, userinterfaceonly:=True
End Sub
I have locked the entire worksheet sans A10 and A34.
The protection boxes that I checked are:
Select locked cells
Select unlocked cells
Format cells
Format columns
Format rows
Insert columns
When I open the file I am prompted to Enable macros, which I do. I can change cells A10 and A34. However, when I try to Close the open groups columns BCD and FGH by clicking on the "-" button, Excel screams at me with "You cannot use this command...."
What am I doing wrong?
Thanks,
Mike
“Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.”-Albert Einstein