In the debug window: VBA code to say "display content of variable Var1" ?

abdoudiaw

Registered User.
Local time
Yesterday, 21:16
Joined
Sep 13, 2013
Messages
15
Hi,
Debugging my VBA code.
I'm trying to track/display the content/value of a couple of variables to make sure they have the right value at a certain point.
What is the VBA code to say "display content of variable Var1" ?
Where exactly will it display the value when instruction is executed?
PS: I know I can just hover the mouse on a variable to see its content but some string varables like SELECT commands are too long and you cannot see the whole string.
Thanks.
 
Re: In the debug window: VBA code to say "display content of variable Var1" ?

You can

1. Use Debug.Print to display them in the Immediate window.
2. Use MsgBox to show the variable values.
3. Add them to the Watches window.
 
Re: In the debug window: VBA code to say "display content of variable Var1" ?

In the IMMEDIATE window, if you are inside the routine where Var1 is in context/scope,

debug.print var1

Format will be whatever is natural to var1
 

Users who are viewing this thread

Back
Top Bottom