简体   繁体   中英

Where does VBA Debug.Print log to?

Debug.Print在哪里输出消息?

Where do you want to see the output?

Messages being output via Debug.Print will be displayed in the immediate window which you can open by pressing Ctrl + G .

You can also Activate the so called Immediate Window by clicking View -> Immediate Window on the VBE toolbar

在此处输入图片说明

Debug.Print outputs to the "Immediate" window.

Debug.Print输出到立即窗口

Also, you can simply type ? and then a statement directly into the immediate window (and then press Enter) and have the output appear right below, like this:

只需键入?然后将一条语句直接放入立即窗口

This can be very handy to quickly output the property of an object...

? myWidget.name

...to set the property of an object...

myWidget.name = "thingy"

...or to even execute a function or line of code, while in debugging mode:

Sheet1.MyFunction()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM