So far, you have been using the Immediate window as a sort of global message
box. Although Debug.Print sends useful messages during
program execution, it is also possible to type directly into the Immediate window.
What can you type? For starters, you can use the same Debug.Print
commands that you have been using so far in code. Figure 18.17 shows an
example. The syntax is as follows:
Debug.Print "Insert Your Message Here"
FIGURE 18.17 Debug.Print commands can be entered directly into the Immediate
Because the Debug object is the default object for
the Immediate window, you can take advantage of some shortcuts. As this example
shows, Debug.Print can be abbreviated either to
Print or just ?. The method is invoked just as if you typed it completely,
so you may as well save yourself that extra typing.
Besides printing messages, the Immediate window can perform a few other useful
tricks when you use it interactively. You will look at those next.
Querying or Modifying Data Values
Testing and Executing VB Procedures