Skip to main content

Locals window

Table of contents
  1. Window elements

Automatically displays all of the declared variables in the current procedure and their values.

When the Locals window is visible, it is automatically updated every time there is a change from run time to break mode or you navigate in the stack display.

You can:

  • Resize the column headers by dragging the border to the right or the left.
  • Close the window by clicking the Close box. If the Close box is not visible, double-click the title bar to make the Close box visible, and then select it.

Window elements

Element Description
Calls Stack button Opens the Call Stack dialog box, which lists the procedures in the call stack.
Expression Lists the name of the variables.

The first variable in the list is a special module variable and can be expanded to display all module level variables in the current module. For a class module, the system variable <Me> is defined. For standard modules, the first variable is the <name of the current module>. Global variables and variables in other projects are not accessible from the Locals window.

You cannot edit data in this column.

Value Lists the value of the variable.

When you click a value in the Value column, the cursor changes to an I-beam. You can edit a value and then press ENTER, the UP ARROW key, the DOWN ARROW key, TAB, SHIFT+TAB, or click on the screen to validate the change. If the value is illegal, the Edit field remains active and the value is highlighted. A message box describing the error also appears. Cancel a change by pressing ESC.

All numeric variables must have a value listed. String variables can have an empty Value list.

Variables that contain subvariables can be expanded and collapsed. Collapsed variables don't display a value, but each subvariable does. The expand icon Expand icon and the collapse icon Collapse icon appear to the left of the variable.

Type Lists the variable type. You cannot edit data in this column.

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>