Share via


Protection.AllowInsertingRows Property (Excel)

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

Syntax

expression .AllowInsertingRows

expression A variable that represents a Protection object.

Remarks

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

Example

This example allows the user to insert rows on the protected worksheet and notifies the user.

Sub ProtectionOptions() 
 
 ActiveSheet.Unprotect 
 
 ' Allow rows to be inserted on a protected worksheet. 
 If ActiveSheet.Protection.AllowInsertingRows = False Then 
 ActiveSheet.Protect AllowInsertingRows:=True 
 End If 
 
 MsgBox "Rows can be inserted on this protected worksheet." 
 
End Sub

See Also

Concepts

Protection Object

Protection Object Members