Skip to main content

Range.Errors property

Table of contents
  1. Syntax
  2. Remarks
  3. Example

Allows the user to access error checking options.



expression A variable that represents a Range object.


Reference the Errors object to view a list of index values associated with error checking options.


In this example, a number written as text is placed in cell A1. Microsoft Excel then determines if the number is written as text in cell A1 and notifies the user accordingly.

Sub CheckForErrors()
    Range("A1").Formula = "'12"
    If Range("A1").Errors.item(xlNumberAsText).Value = True Then
        MsgBox "The number is written as text."
        MsgBox "The number is not written as text."
    End If
End Sub

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>