Excel: Allowing a macro to proceed if it encounters an error condition

While building an Excel macro, occasionally, you may need to plan for an error condition where. In such a condition, if an error occurs, you may want the routine to ignore the current error and move to the next command. To do this, all you need to do is pre-pend the command with the following line of VB code:

On Error Resume Next

I’ve had to use this when I build a macro to filter content in tables. This is specifically when I need to clear all filters in a table, where the table may be in a condition where the filters are already cleared.

Leave a Reply

Your email address will not be published. Required fields are marked *