Debugging Macros

You step into procedures by pressing F8 or by clicking Debug O Step Into . You can continue walking through an entire procedure using the Step Into command. If your procedure contains calls to other procedures, you can step through those procedures by using the Step Into command. If you do not want to step through those procedures, you can step over them and continue processing the current one. To step over the highlighted procedure, click Debug O Step Over or press Shift+F8. Doing this instructs the Visual Basic Editor to execute the entire called procedure without stopping and to return control to the next line in the original procedure.

Even if you decide to step through the called procedure, you still have the option of stepping out of it at any time. To step out of a called procedure, click Debug O Step Out or press Ctrl+Shift+F8. When you select this option, the remainder of the called procedure executes and then control returns to the original procedure. Whenever control returns from a called procedure, the control passes to the next line of code after the procedure that called the outside procedure.

-■ The first line of code in the procedure is highlighted.

Q Continue pressing F8 to step through the entire procedure.

■ As you step through the code, local variable values display in the Locals window and any watches set display in the Watches window.

-■ The first line of code in the procedure is highlighted.

0 Press F8 to move to execute that code and move to the next line.

Q Continue pressing F8 to step through the entire procedure.

■ As you step through the code, local variable values display in the Locals window and any watches set display in the Watches window.

EXCEL PROGRAMMING

0 0

Post a comment