Immediate Window

Office 2013 and later

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.


Allows you to:

  • Type or paste a line of code and press ENTER to run it.

  • Copy and paste the code from the Immediate window into the Code window but does not allow you to save code in the Immediate window.

The Immediate window can be dragged and positioned anywhere on your screen unless you have made it a dockable window from the Docking Tab of the Options dialog box.

You can 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, then click it.

Note Note

In break mode, a statement in the Immediate window is executed in the context or scope that is displayed in the Procedure box. For example, if you type Print variablename, your output is the value of a local variable. This is the same as if the Print method had occurred in the procedure you were executing when the program halted.