Chapter 8. Debugging Macros

Debug a Procedure with Inserted Breakpoints

Correcting errors, often referred to as debugging, is a normal part of writing a program. VBA has several tools you can use to debug your procedures. For example, you can insert breakpoints in your procedures. Breakpoints suspend the execution of a procedure at the points you specify. Once the program stops, you can examine the results and then continue the execution of the program.

You set a breakpoint by clicking the margin of the Code window next to the line where you want to insert the breakpoint. The VBE places a circle in the margin and highlights the line of code using the display options you set for the Code window. See Chapter 2 for more information on setting the display ...

Get Excel® Programming: Your visual blueprint™ for creating interactive spreadsheets now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.