Protection.AllowDeletingColumns 属性 (Excel)

如果允许删除受保护工作表上的列,则返回 True。 只读 Boolean

语法

表达式AllowDeletingColumns

表达 一个代表 Protection 对象的变量。

备注

可以使用 Protect 方法参数设置 AllowDeletingColumns 属性。

对于受保护的工作表,必须取消对包含要删除的单元格的列的锁定。

示例

本示例解锁列 A,然后允许用户删除受保护工作表上的列 A。

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

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。