Microsoft KB Archive/31691

{| = Excel: Suppressing Error Alerts in Macro or Branching at Error =
 * width="100%"|

Last reviewed: October 31, 1994

Article ID: Q31691

SUMMARY
To temporarily turn error checking off during a macro, use the function =ERROR(FALSE).

To run a different macro if an error occurs, use the function =ERROR(TRUE,ref), where ref is the reference of the macro to run should an error occur.

For example, when using DATA.FIND(TRUE) in a macro, to prevent the &quot;No Match&quot; alert when no database records match the criteria on the worksheet, use the following macro steps

=ERROR(TRUE,ref) =DATA.FIND(TRUE) where ref is the location to go to when DATA.FIND(TRUE) does not find any records. This procedure can be can be used with other functions, such as FORMULA.FIND and OPEN.
 * }