Protection.AllowDeletingRows property (Excel)

Returns True if the deletion of rows is allowed on a protected worksheet. Read-only Boolean.

Syntax

expression.AllowDeletingRows

expression A variable that represents a Protection object.

Remarks

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

The rows containing the cells to be deleted must be unlocked when the sheet is protected.

Example

This example unlocks row 1, and then allows the user to delete row 1 on the protected worksheet.

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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.