This topic has not yet been rated - Rate this topic

Protection.AllowFiltering Property (Excel)

Published: July 16, 2012

Returns True if the user is allowed to make use of an AutoFilter that was created before the sheet was protected. Read-only Boolean.

expression .AllowFiltering

expression A variable that represents a Protection object.

The AllowFiltering property can be set by using the Protect method arguments.

The AllowFiltering property allows the user to change filter criteria on an existing AutoFilter. The user cannot create or remove an AutoFilter on a protected worksheet.

The cells to be filtered must be unlocked when the sheet is protected.

This example allows the user to filter row 1 on the protected worksheet and notifies the user.

Sub ProtectionOptions() 
 
 ActiveSheet.Unprotect 
 
 ' Unlock row 1. 
 Rows("1:1").Locked = False 
 
 ' Allow row 1 to be filtered on a protected worksheet. 
 If ActiveSheet.Protection.AllowFiltering = False Then 
 ActiveSheet.Protect AllowFiltering:=True 
 End If 
 
 MsgBox "Row 1 can be filtered on this protected worksheet." 
 
End Sub

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.