Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Errors Property
Collapse the table of content
Expand the table of content

Range.Errors Property

Office 2007
Allows the user to to access error checking options.

Syntax

expression.Errors

expression   A variable that represents a Range object.

Remarks

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

Example

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.

Visual Basic for Applications
Sub CheckForErrors()

    Range("A1").Formula = "'12"

    If Range("A1").Errors.Item(xlNumberAsText).Value = True Then
        MsgBox "The number is written as text."
    Else
        MsgBox "The number is not written as text."
    End If

End Sub



Community Additions

ADD
Show:
© 2015 Microsoft