共用方式為


Protection.AllowDeletingColumns 屬性 (Excel)

如果允許使用者在受保護工作表上刪除欄,則會傳回 True。 唯讀的 Boolean

語法

表達。允許刪除資料行

代表 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 支援與意見反應