Using the Watch Window
The watch window is used to monitor expressions as your code runs. Unlike the Locals window that you can use to observe your variables as your code runs, you can use to watch window to observe whole expressions that you enter in the window. The expression can be a variable, a call to a function, or any other valid expression.
To display your Watch window, do the following:
–or–
Adding a Watch Expression
There are three types of watch expressions in VBA.
To add a Watch expression, do the following:
  1. On the Visual Basic Editor menu bar, click Debug and select Add Watch from the menu.
  1. In the Expression text box, enter the expression that you want to monitor.
  1. Under Context , select the procedure or module name that you want to set as the scope for the watch expression using the Procedure and Module drop-down lists.
  1. Under Watch Type , select the Watch type you want to create from the three options. This determines how VBA will respond to the watch expression.
  1. Click OK when done.
Tip : A watch expression can be particularly useful when you have a loop with a lot of iterations and you want to enter break mode near the end of the loop counter. Using Step Into to step through the code can be time-consuming for a very large loop. With the Watch window, you can set an expression that watches the loop counter and then breaks when it reaches a certain value.