Microsoft Office Tutorials and References
In Depth Information
Weapons of Mass Debugging
Using the Step Out Command
The Step Out command executes the remaining lines of code between and including the current
highlighted execution point and the End Sub line. You might think by the name Step Out that it
refers to simply exiting the Step Into command, but that is not exactly the case. Though it does
result in exiting the step through process, it does so by executing the rest of the macro to get to the
end. If you want to exit any of the step through process, click the Reset button.
One of VBA’s convenient features is the ability to set a breakpoint , where you can specify a line of
code that will be the point up to which the macro would run at full speed. When the macro’s
execution reaches the breakpoint code line, VBA switches to Break mode and halts the execution process.
Stepping through your macro is a good way to examine each line of code,
but when your macros are hundreds of lines long, a line-by-line examination
process is tedious and time consuming. There will be many statements in your
code that won’t need to be examined, and there’s no reason to inch your way
to the section of your macro where the error probably resides. This is where
breakpoints come in handy.