I'd like to display the results calculated within a macro in a message box in
order to debug the code. How would I do this? Alternatively, is there a
better way to do this?
Thanks,
Barb Rienhardt
I'd like to display the results calculated within a macro in a message box in
order to debug the code. How would I do this? Alternatively, is there a
better way to do this?
Thanks,
Barb Rienhardt
debug.print x
This will print the variable x to the immediate window.
--
Ian
--
"Barb Reinhardt" <[email protected]> wrote in message
news:[email protected]...
> I'd like to display the results calculated within a macro in a message box
> in
> order to debug the code. How would I do this? Alternatively, is there a
> better way to do this?
>
> Thanks,
> Barb Rienhardt
Um ... what is the immediate window. I added it and see nothing.
"Ian" wrote:
> debug.print x
>
> This will print the variable x to the immediate window.
>
> --
> Ian
> --
> "Barb Reinhardt" <[email protected]> wrote in message
> news:[email protected]...
> > I'd like to display the results calculated within a macro in a message box
> > in
> > order to debug the code. How would I do this? Alternatively, is there a
> > better way to do this?
> >
> > Thanks,
> > Barb Rienhardt
>
>
>
You could use:
msgbox X
sprinkled throughout your code.
Next time you're in the VBE, hit ctrl-g. You'll see the immediate window.
It's nice to show things there--so you don't have to dismiss each msgbox.
Barb Reinhardt wrote:
>
> Um ... what is the immediate window. I added it and see nothing.
>
> "Ian" wrote:
>
> > debug.print x
> >
> > This will print the variable x to the immediate window.
> >
> > --
> > Ian
> > --
> > "Barb Reinhardt" <[email protected]> wrote in message
> > news:[email protected]...
> > > I'd like to display the results calculated within a macro in a message box
> > > in
> > > order to debug the code. How would I do this? Alternatively, is there a
> > > better way to do this?
> > >
> > > Thanks,
> > > Barb Rienhardt
> >
> >
> >
--
Dave Peterson
In the VBE
In the menu, select View, then Immediate Window
(or do Ctrl+G)
--
Regards,
Tom Ogilvy
"Barb Reinhardt" <[email protected]> wrote in message
news:[email protected]...
> Um ... what is the immediate window. I added it and see nothing.
>
> "Ian" wrote:
>
> > debug.print x
> >
> > This will print the variable x to the immediate window.
> >
> > --
> > Ian
> > --
> > "Barb Reinhardt" <[email protected]> wrote in
message
> > news:[email protected]...
> > > I'd like to display the results calculated within a macro in a message
box
> > > in
> > > order to debug the code. How would I do this? Alternatively, is
there a
> > > better way to do this?
> > >
> > > Thanks,
> > > Barb Rienhardt
> >
> >
> >
Barb,
In the VBIDE, hit Ctrl-G, you will see a small window pop-up. You can output
to this window i your code, using Debug.Print, or you can test something
directly in that window, using the ? operator, like breaking at a point in
the code and typing
?myVar
will display the current value of myVar
--
HTH
RP
(remove nothere from the email address if mailing direct)
"Barb Reinhardt" <[email protected]> wrote in message
news:[email protected]...
> Um ... what is the immediate window. I added it and see nothing.
>
> "Ian" wrote:
>
> > debug.print x
> >
> > This will print the variable x to the immediate window.
> >
> > --
> > Ian
> > --
> > "Barb Reinhardt" <[email protected]> wrote in
message
> > news:[email protected]...
> > > I'd like to display the results calculated within a macro in a message
box
> > > in
> > > order to debug the code. How would I do this? Alternatively, is
there a
> > > better way to do this?
> > >
> > > Thanks,
> > > Barb Rienhardt
> >
> >
> >
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks