Protection.AllowInsertingColumns property (Excel)

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

Syntax

expression.AllowInsertingColumns

expression A variable that represents a Protection object.

Remarks

An inserted column inherits its formatting (by default) from the column to its left, which means that it may have locked cells. In other words, users may not be able to delete columns that they have inserted.

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

Example

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

Sub ProtectionOptions() 
 
 ActiveSheet.Unprotect 
 
 ' Allow columns to be inserted on a protected worksheet. 
 If ActiveSheet.Protection.AllowInsertingColumns = False Then 
 ActiveSheet.Protect AllowInsertingColumns:=True 
 End If 
 
 MsgBox "Columns can be inserted 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.