Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ian Ian is offline
external usenet poster
 
Posts: 238
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default 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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
if, then display message puiuluipui Excel Discussion (Misc queries) 1 October 2nd 09 05:28 AM
Display a message Jarek Kujawa[_2_] Excel Worksheet Functions 0 June 3rd 08 02:44 PM
Display a message Ridhi Excel Worksheet Functions 4 June 3rd 08 02:43 PM
How do I display a message when a cell has a certain value?? [email protected] Excel Discussion (Misc queries) 4 March 28th 07 04:12 PM
How to display a message box Salman[_2_] Excel Programming 1 November 5th 03 05:01 PM


All times are GMT +1. The time now is 03:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"