View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
RADO[_3_] RADO[_3_] is offline
external usenet poster
 
Posts: 79
Default Grouping & collasping in a protected worksheet

for Excel 2002, you can use the code below. Most setting are
self-explanatory, the only thing is the last line - .EnableOutlining - this
allows to enable outline symbols to collapse/expand spreadsheet.

Best -
RADO

Public Sub Set_Protection()
' Protects worksheet and enables outline symbols

With Sheets("MySheet")
.Protect _
DrawingObjects:=True, _
Contents:=True, _
Scenarios:=True, _
UserInterfaceOnly:=True, _
AllowFormattingCells:=True, _
AllowFormattingColumns:=True, _
AllowFormattingRows:=True, _
AllowInsertingColumns:=False, _
AllowInsertingRows:=False, _
AllowInsertingHyperlinks:=True, _
AllowDeletingColumns:=False, _
AllowDeletingRows:=False, _
AllowSorting:=True, _
AllowFiltering:=True, _
AllowUsingPivotTables:=True

.EnableSelection = xlNoRestrictions
.EnableOutlining = True
End with
End Sub



"Janice" wrote in message
...
HELP!

I have created an Excel form and created groups that can
be expanded or collapsed by the user. However, once I
protect the sheet the user is denied access to the +/-
button that will perform the function. I have tried
adding a command button to use as a macro but the macro I
recorded won't perform the expand & collapse feature. Any
one have an alternative method?