HDI wrote:
Hi,
I've got following code:
For each ....
on error goto errhand
errhand:
...
next
As the others have said, and I will say frankly, this is very bad practice.
Asjust your code like this:
On error goto errhand 'This should be at the START of your code!
For each....
next....
Exit_Proc:
Exit sub (or function)
Errhand:
Put your stuff here. If on a specific error you want to return to the
next or same line use resume or resume next. If you want to quit the
procedure, use resume exit_proc.
If you want to have different error routines for different parts of the
procedure, you can do this, but I won't submit how I do it, because IMO,
if you're writing code like the above, you need more experience.
--
Tim
http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me