VBA Error Function: The Error function in VBA returns the error message corresponding to a supplied error code.

Syntax

Parameter

ErrorNumber (optional) – This parameter represents the required error number. By default, the Error function returns the most recent run-time error.

Return

This function returns the error message corresponding to a supplied error code. It returns an empty String, if the parameter ErrorNumber is zero or is skipped and there have not been any run-time errors.

Example 1

Output

VBA Error Function

Example 2

Output

VBA Error Function

Example 3

Output

VBA Error Function

Pin It on Pinterest

Share This