AllowInsertingColumns 属性

       

如果允许在受保护的工作表上插入列,则返回 TrueBoolean 类型,只读。

expression.AllowInsertingColumns

expression   必需。该表达式返回一个 Protection 对象。

说明

默认情况下,插入的列继承了其左边的列的格式设置,这意味着该列可能包含锁定的单元格。也就是说,用户可能不能删除插入的列。

可用 Protect 方法的参数设置 AllowInsertingColumns 属性。

示例

本示例允许用户在受保护的工作表上插入列,并通知用户。

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