Excel · मराठी आवृत्ती
12.15 Debugging — प्रत्येक lineचा result पाहा
| Tool | Windows shortcut / menu | कशासाठी? |
|---|---|---|
| Step Into | F8 | एक line चालवा; yellow line पुढची आहे. |
| Breakpoint | Margin click / F9 | F5 run तिथे pause. |
| Run to Cursor | Ctrl + F8 | Cursor lineपर्यंत run. |
| Hover | Paused variableवर pointer | Value पाहा. |
| Immediate | Ctrl + G | Debug.Print किंवा ?r. |
| Locals | View › Locals Window | Current scopeच्या variables. |
| Watch | Right-click › Add Watch | Expression पाहा; change/Trueवर break. |
| Compile | Debug › Compile VBAProject | Syntax आणि declaration errors. |
| Reset | Stop square | Execution थांबवा. |
एक row कमी copy होत असेल तर
Combine macroच्या destRow update lineवर breakpoint लावा. F5, मग F8ने दोन sheets process करा. Localsमध्ये lastRow, destRow आणि copied range पाहा. Header एकदाच धरला आहे का तपासा.
Compile errors पकडतो; चुकीचं total किंवा off-by-one business logic आपोआप पकडेलच असं नाही. Reset/End केल्यास सामान्य cleanup code चालेलच असं नाही; Application settings तपासा.
Practice
LoopExamplesच्या For loopमध्ये breakpoint. Immediateमध्ये ?r आणि ?ws.Cells(r,8).Value print करा. Next rनंतर counter आणि next target कसा बदलतो ते पाहा.