Hi,

I have this macro that protects all my sheets in a workbook, and still allows it to filter..

But, i want it to allow more things.

I want to set up the protection as followed (with password):

Select locked cells
Select unlocked cells
Format cells
Use AutoFilter
Edit objects
Edit Scenarios


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Protect Password:="1234", AllowFiltering:=True
Next ws
End Sub
filter1.png
filter2.png

Anyone who can help ?

Thank you in advance