views:

32

answers:

2

I'm teaching myself (read hacking) through some old Excel Macros that are quite long. However, as I change quite a few lines I want to be sure that I know when and where my new and re-hashed elements are occuring - or not. So my question/s is:

  • How do I insert a simple message box function that will pop up when a loop/procedure/event has finished?
  • Add text to it explaining what happened (hard coded ofcourse)?
  • Also, include an "OK button" that makes it start the next procedure?

The breakpoint process may be the most effective way of doing this, but I would like to use the message box approach so that I can show my colleagues what is happening. Also it would be something that I'd like to incorporate into future projects.

Many thanks for any examples, links or helpful hints. Michael.

+1  A: 

Just use

MsgBox ("message here")

And if you want to go to the code so that you can debug from there on use CTRL + BREAK

Sjuul Janssen
+1. Actual code is better than just links.
Geoffrey Van Wyk
Should be: `MsgBox "message here"` - i.e. no parentheses unless you are using `Call`
barrowc
or unless you're adding yes/no buttons and want to do something with the answer
Sjuul Janssen