Remarks

Use the property of the object to return an Errors object.

Example

Once an Errors object is returned, you can use the Value property of the object to check for particular error-checking conditions. The following example places a number as text in cell A1 and then notifies the user when the value of cell A1 contains a number as text.

Visual Basic for Applications
Sub ErrorValue() ' Place a number written as text in cell A1. Range("A1").Formula = "'1" If Range("A1").Errors.Item(xlNumberAsText).Value = True Then MsgBox "Cell A1 has a number as text." Else MsgBox "Cell A1 is a number." End If End Sub

See also: