I’m looking to protect a worksheet, but allow grouped columns to be collapsed or expanded. Also would like to allow the user to set filters and hide columns. I put the below code in the “ThisWorkbook” object. This protected the worksheet but not with a password. The VBA below allowed the grouped columns to expand and collapse. It also allowed columns to be hidden, but did not allow filtering. Not an expert with VBA so looking for help. Also, if I decide to password protect, where would I enter that in the VBA?
Thanks for your help.
Private Sub Workbook_Open()
With Worksheets("Sheet1")
.EnableOutlining = True
.Protect UserInterfaceOnly:=True
.Protect AllowFiltering:=True
.Protect AllowFormattingColumns:=True
End With
End Sub
Thanks for your help.
Private Sub Workbook_Open()
With Worksheets("Sheet1")
.EnableOutlining = True
.Protect UserInterfaceOnly:=True
.Protect AllowFiltering:=True
.Protect AllowFormattingColumns:=True
End With
End Sub