您的位置:首页 > 编程语言 > VB

【Excel VBA】debugging

2019-03-23 16:57 204 查看

1. Step info 【F8】

调试代码时,用F8可以逐行运行

Step info在debug小窗口中也有

2.Break point【F9】

选中代码行,F9设置为Break point,代码运行到该行自动停止

3.Immediate window

3.1 debug.print =》即时输出运行结果

3.2 query =》以?开头

3.3 run a statement

4. Locals Window

自动显示当前过程中所有声明的变量以及它们的值。Shows details of all variables you created.
当从运行时切换为中断模式(STOP)时,Locals window中的变量自动清空。

但是,Local window中各变量的property只能看,不能筛选

5. Watch window

Allow you to filter the property you’re interested in =》选中变量,直接拖拽到watch window / 右键后add to watch window


直接在变量后,输入property名称,回车,在Value一栏就能看到filter结果

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: