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