Microsoft Office Tutorials and References
In Depth Information
To add a variable to the Watches window, right-click the variable name in your code and select
Add Watch from the popup menu. To add an expression to the Watches window:
Move the editing cursor to any location in the code you are debugging.
Select Add Watch from the Debug menu. VBA displays the Add Watch dialog box (see
Enter the desired watch expression in the Expression box.
Make sure the Watch Expression option is selected.
Each time the program enters break mode the display in the Watches window is updated. Then,
you can examine the values of your watch expressions to determine whether they reveal anything
about the bug you are working on. You can also edit a watch expression, or delete it from the
window, by right-clicking it and selecting from the popup menu.
Adding a watch expression to the Watches window.