ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Message Display (https://www.excelbanter.com/excel-programming/343780-message-display.html)

Barb Reinhardt

Message Display
 
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

Ian

Message Display
 
debug.print x

This will print the variable x to the immediate window.

--
Ian
--
"Barb Reinhardt" wrote in message
...
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 Reinhardt

Message Display
 
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" wrote in message
...
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

Message Display
 
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" wrote in message
...
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

Tom Ogilvy

Message Display
 
In the VBE

In the menu, select View, then Immediate Window

(or do Ctrl+G)

--
Regards,
Tom Ogilvy

"Barb Reinhardt" wrote in message
...
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" wrote in

message
...
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







Bob Phillips[_6_]

Message Display
 
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" wrote in message
...
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" wrote in

message
...
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








All times are GMT +1. The time now is 05:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com