How to handle more then 1 error Handler's in VBA excel -


please find below error handle code.

sub trial() on error goto myhandler s = 15 / 0 myhandler: s = 0  on error goto my2handler h = 10 / 0 handler: h = 0  end sub 

my second error handler i.e. my2handler not working , not able use both error handler's in 1 sub.

you can use resume below:

sub trial()  check1:     on error goto myhandler     s = 15 / 0  check2:     on error goto my2handler     h = 10 / 0  exit sub  myhandler:     s = 0     resume check2  my2handler:     h = 0  end sub 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -