Personally I think telling you to look in Help isn't the most helpful suggestion in this case. The way that error handling works in VBA is clunky and not really intuitive, and the explanations generally provided tend to make sense to people who already understand the process and be as clear as mud to everybody else.
Firstly you should consider each Procedure (Sub or Function) as a separate unit. Within an individual procedure, error handling is either "enabled" or it isn't.
If it is *not* enabled then, when an error occurs, the error is considered to have happened in the higher level procedure which called the one in which the error actually occurred - and the same determination of whether or not error handling is enabled in that higher level procedure takes place. Error handling is always, effectively, enabled at the very highest level (VBA itself, which calls your top level procedure) and, if there is nothing else then that will kick in and give you the standard VBA error msgbox.
If it *is* enabled, then, when an error occurs, the error handling procedure will be invoked, at which point it is considered "active" and, in effect, no longer "enabled". You remain in error handling mode, with your error handler "active" until you do something about it. That something is to
Resume normal code. Most of the time, your code can run either in error handling mode or not in it, and there are very few differences you can observe.
So, in your example, the first time you get an error, your enabled error handler becomes active and, as you don't Resume, the next time you get an error you do not have an enabled error handler so the error is considered to be in the calling routine (VBA itself), which handles the error by issuing the msgbox you see.
Error handling remains enabled until either it becomes active, or it is explicitly disabled. When you resume, your active error handler becomes enabled again; you do not need to constantly enable it and having your On Error inside a loop is pointless unless it is also explicitly disabled within the same loop.
Enjoy,
Tony
------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
I'm working (slowly) on my own website