Error.Ignore 属性 (Excel)

允许用户设置或返回某一区域的错误检查选项的状态。 如果该值为 False,则某一区域的错误检查选项可用。 如果该值为 True,则禁用某一区域的错误检查选项。 读/写 Boolean

语法

表达式忽略

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

备注

引用 ErrorCheckingOptions 对象以查看与错误检查选项关联的索引值列表。

示例

本示例为检查空单元格引用而禁用单元格 A1 中的忽略标记。

Sub IgnoreChecking() 
 
 Range("A1").Select 
 
 ' Determine if empty cell references error checking is on, if not turn it on. 
 If Application.Range("A1").Errors(xlEmptyCellReferences).Ignore = True Then 
 Application.Range("A1").Errors(xlEmptyCellReferences).Ignore = False 
 MsgBox "Empty cell references error checking has been enabled for cell A1." 
 Else 
 MsgBox "Empty cell references error checking is already enabled for cell A1." 
 End If 
 
End Sub

支持和反馈

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