Class Protection (Excel VBA)

The class Protection represents the various types of protection options available for a worksheet.

Class Worksheet gives access to class Protection.

Member in collection

Item

To use a Protection class variable it first needs to be instantiated, for example

Dim prt as Protection
Set prt = ActiveSheet.Protection

Protection class variables can be set using the Worksheet.Protection procedure.

Properties

AllowDeletingColumns returns True if the deletion of columns is allowed on a protected worksheet.

AllowDeletingRows returns True if the deletion of rows is allowed on a protected worksheet.

AllowEditRanges returns an AllowEditRanges object.

AllowFiltering returns True if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.

AllowFormattingCells returns True if the formatting of cells is allowed on a protected worksheet.

AllowFormattingColumns returns True if the formatting of columns is allowed on a protected worksheet.

AllowFormattingRows returns True if the formatting of rows is allowed on a protected worksheet.

AllowInsertingColumns returns True if the insertion of columns is allowed on a protected worksheet.

AllowInsertingHyperlinks returns True if the insertion of hyperlinks is allowed on a protected worksheet.

AllowInsertingRows returns True if the insertion of rows is allowed on a protected worksheet.

AllowSorting returns True if the sorting option is allowed on a protected worksheet.

AllowUsingPivotTables returns True if the user is allowed to manipulate PivotTables on a protected worksheet.

AllowEditRanges - A collection of all the AllowEditRange objects that represent the cells that can be edited on a protected worksheet.