The Visual Basic Editor provides several tools to help you write error-free code. However, sometimes a procedure does not act the way you expect it to. To deal with this problem, you can use the Editor's debugging tools to help you locate the source of the trouble. One the most common approaches to debug failed code is to "walk through" the procedure step by step, examining each thing the procedure does. In this way, you can try to locate the exact statement that is causing you trouble.
Stepping Through a Procedure