This quick tip shows you how to show the immediate window in Visual Basic for Applications (or VBA) for Excel .
Show the immediate window
The immediate window allows you to test single lines of code. In most cases, you use Debug.Print to run single line commands in VBA.
So, here is a quick video showing you how to display the immediate window in VBA.
Test it out
Once you get the immediate window open, try typing some commands. So, for starters, one thing you can test is displaying the contents of a cell. Try this…
- Type something in a cell, such as Hi or Hello in cell A1.
- In the immediate window, type Debug.Print Range(“A1”).Text and press Enter. As a result, it should show whatever value you have in cell A1.