Protection Object
Excel Developer Reference |
Represents the various types of protection options available for a worksheet.
Remarks
Use the Protection property of the Worksheet object to return a Protection object.
Once a Protection object is returned, you can use its following properties, to set or return protection options.
- AllowDeletingColumns
- AllowDeletingRows
- AllowFiltering
- AllowFormattingCells
- AllowFormattingColumns
- AllowFormattingRows
- AllowInsertingColumns
- AllowInsertingHyperlinks
- AllowInsertingRows
- AllowSorting
- AllowUsingPivotTables
Example
The following example demonstrates how to use the AllowInsertingColumns property of the Protection object, placing three numbers in the top row and protecting the worksheet. Then this example checks to see if the protection setting for allowing the insertion of columns is False and sets it to True, if necessary. Finally, it notifies the user to insert a column.
Visual Basic for Applications |
---|
|
See Also