Protect sheet with AllowFiltering not working

jsima

New Member
Joined
Mar 15, 2012
Messages
5
I have a macro to protect a sheet, but enable the filter function. The macro is as follows. However, the coding disabled the filtering even I enable the autofilter and allow the filtering. Can anyone please tell me where's wrong with the macro? I really appreciate your help. Thank you!
Code:
'Protects sheet ABC
        Sheets("ABC").Protect Password:="abc", DrawingObjects:=False, Contents:=True, Scenarios:= _
        False, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
        AllowFormattingRows:=True, AllowInsertingRows:=False, _
        AllowInsertingHyperlinks:=True, AllowSorting:=True, AllowFiltering:=True _
        , AllowUsingPivotTables:=True, UserInterfaceOnly:=True
        Sheets("ABC").EnableAutoFilter = True
        Sheets("ABC").EnableOutlining = True
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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