Testing VBA Procedures

When testing your VBA procedure, use the following guidelines:

If you want to analyze your procedure, step through your code one line at a time by pressing F8 or by choosing Debug | Step Into. If you suspect that an error may occur in a specific place in your procedure, use a breakpoint.

If you want to monitor the value of a particular variable or expression used by your procedure, add a watch expression.

If you are tired of scrolling through a long procedure to get to sections of code that interest you, set up a bookmark to quickly jump to the desired location.

Each of the above guidelines is demonstrated in a hands-on exercise in this chapter.

0 0

Post a comment