View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Stefi Stefi is offline
external usenet poster
 
Posts: 2,646
Default Can't fix On Error statement

So, if you could let me know if this would be correct description:
1. this bit "On Error Resume Next" makes the code jump to next
statement in the code, i.e., "If Err.Number = 0"


Yes, if you placed "If Err.Number = 0" statement after the statement causing
the error.

2. the "Err.Number = 0" basically means that there is no Error, i.e, if
there is an error, then "If Err.Number = 0" returns FALSE.


Yes, but it doesn't trigger anything! It only gives you the opportunity to
create branches for normal case and error case. The "On Error GoTo 0" only
stops any Error handling.

3. the "On Error GoTo 0" in turn stops any Error handler and thus the
code just proceeds to next statement, i.e. "Next v"


Yes, AND it sets back Err.Number to 0!!! That was the mistake in my first
(wrong) post.

Have a look at On Error in XL Help, there is another facility there (On
Error GoTo line) for more complicated cases.

Regards,
Stefi