Share via


AllowDeletingColumns Property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

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

expression.AllowDeletingColumns

expression   Required. An expression that returns a Protection object.

Remarks

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

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

Example

This example unlocks column A then allows the user to delete column A on the protected worksheet and notifies the user.

  Sub ProtectionOptions()

    ActiveSheet.Unprotect

    'Unlock column A.
    Columns("A:A").Locked = False

    ' Allow column A to be deleted on a protected worksheet.
    If ActiveSheet.Protection.AllowDeletingColumns = False Then
        ActiveSheet.Protect AllowDeletingColumns:=True
    End If

    MsgBox "Column A can be deleted on this protected worksheet."

End Sub