ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA on error next ..... (https://www.excelbanter.com/excel-programming/398451-vba-error-next.html)

Daniel

VBA on error next .....
 
How can I add to my macro so that when it has an error it will by pass go
next step
or it will ignor and finish.
Thanks
Daniel

Tom Ogilvy

VBA on error next .....
 
On error resume next
'troublesome code
On error goto 0 ' restore normal error handling

I would use this sparingly and only suppress errors where you absolutely
know it is appropriate (don't but it at the top of every module - if you do,
you will not understand why your code doesn't work).

--
Regards,
Tom Ogilvy

"Daniel" wrote:

How can I add to my macro so that when it has an error it will by pass go
next step
or it will ignor and finish.
Thanks
Daniel



All times are GMT +1. The time now is 10:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com