![]() |
How do I view the value of a variable in my code?
There are a few things you can do:
1) Put MsgBox MyVar at various places in code if you want to pop up the values from time to time to see what is happening. 2) If the code is paused (break mode) you can use the immediate pane and print the values, e.g.: print MyVar or simply: ? MyVar 3) Open up the locals Window: it shows the current value of all variables in a "tree" type structure (for the objects) Immediate Pane and Locals window are available in View menu "Bill_S" wrote: In the VBA window how can I check the current value of one of the variables in my code? |
How do I view the value of a variable in my code?
Thank you. Inserting the MsgBox MyVar within the code was helpful.
"K Dales" wrote: There are a few things you can do: 1) Put MsgBox MyVar at various places in code if you want to pop up the values from time to time to see what is happening. 2) If the code is paused (break mode) you can use the immediate pane and print the values, e.g.: print MyVar or simply: ? MyVar 3) Open up the locals Window: it shows the current value of all variables in a "tree" type structure (for the objects) Immediate Pane and Locals window are available in View menu "Bill_S" wrote: In the VBA window how can I check the current value of one of the variables in my code? |
All times are GMT +1. The time now is 10:35 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com