Excel) (ErrorCheckingOptions 物件

代表應用程式的錯誤檢查選項。

註解

使用Application 物件的 ErrorCheckingOptions屬性可傳回ErrorCheckingOptions物件。

參考Errors物件的Item屬性,以檢視與錯誤檢查選項相關聯的索引值清單。

傳回 ErrorCheckingOptions 物件之後,您可以使用下列屬性,也就是 ErrorCheckingOptions 物件的成員,來設定或傳回錯誤檢查選項。

  • BackgroundChecking
  • EmptyCellReferences
  • EvaluateToError
  • InconsistentFormula
  • IndicatorColorIndex
  • NumberAsText
  • OmittedCells
  • TextDate
  • UnlockedFormulaCells

範例

下列範例會使用 TextDate 屬性來啟用兩位數年份文字日期的錯誤檢查,然後通知使用者。

Sub CheckTextDates() 
 
 Dim rngFormula As Range 
 Set rngFormula = Application.Range("A1") 
 
 Range("A1").Formula = "'April 23, 00" 
 Application.ErrorCheckingOptions.TextDate = True 
 
 ' Perform check to see if 2 digit year TextDate check is on. 
 If rngFormula.Errors.Item(xlTextDate).Value = True Then 
 MsgBox "The text date error checking feature is enabled." 
 Else 
 MsgBox "The text date error checking feature is not on." 
 End If 
 
End Sub

屬性

另請參閱

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應