Class Error (Excel VBA)

The class Error represents a spreadsheet error for a range. To use a Error class variable it first needs to be instantiated, for example


Dim err as Error
Set err = ActiveCell.Errors(Index:=1)

For Each

Here is an example of processing the Error items in a collection.


Dim err As Error
For Each err In ActiveCell.Errors
	
Next err

Ignore

Allows the user to set or return the state of an error checking option for a range. False enables an error checking option for a range. True disables an error checking option for a range.

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


ActiveCell.Errors(1).Ignore = True

Value

Returns a Boolean value that indicates if all the validation criteria are met (that is, if the range contains valid data).


Dim booValue As Boolean
booValue = ActiveCell.Errors(1).Value