AllowFormattingColumns 属性

       

如果允许对受保护的工作表上的列进行格式设置,则返回 TrueBoolean 类型,只读。

expression.AllowFormattingColumns

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

说明

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

示例

本示例允许用户对受保护的工作表上的列进行格式设置,并通知用户。

Sub ProtectionOptions()

    ActiveSheet.Unprotect

    ' Allow columns to be formatted on a protected worksheet.
    If ActiveSheet.Protection.AllowFormattingColumns = False Then
        ActiveSheet.Protect AllowFormattingColumns:=True
    End If

    MsgBox "Columns can be formatted on this protected worksheet."

End Sub