ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Displaying messages (https://www.excelbanter.com/excel-programming/302350-displaying-messages.html)

Claudia[_4_]

Displaying messages
 
Hello,

Can anyone provide me with code that will display a
message at the beginning of a macro and at the end when it
finishes running?

Thank You



D Van

Displaying messages
 
msgbox ("Begin")
msgbox ("End")

"Claudia" wrote in message
...
Hello,

Can anyone provide me with code that will display a
message at the beginning of a macro and at the end when it
finishes running?

Thank You





Simon Lloyd[_513_]

Displaying messages
 
Claudia, try this........

Dim msgentry as String
Msgentry= "type your message here"
MsgBox msgentry, vbOKOnly, "type the title of the message box here"

The vbOkOnly means the message box will only have an ok button to b
clicked to move on, you only need to type Dim msgentry as String onc
at the top of your code, the rest of it you can use where you like, bu
be warned where ever you put it in your code what ever is taking plac
up to that box will stop until ok is clicked (useful if your checkin
code to see if it works to a certain point!).

Hope this helps

Simo

--
Message posted from http://www.ExcelForum.com


Earl Kiosterud[_3_]

Displaying messages
 
Claudia,

A MsgBox will stop and wait for the user to click something to dismiss the
msgbox and continue the macro. Alternatives include putting a message on
the status bar:

Application.StatusBar = "Initializing"
.....
Application.StatusBar = "Processing record " & RecordNumber
....
Application.StatusBar = False ' reset status bar to Excel control

Another possibility is to use a modeless UserForm (Excel 2000 and later).
In the properties of the UserForm, set ShowModal to False. Now show it.
UserForm1.Show
The macro will continue running, and can put up other UserForms, MsgBoxes,
etc., and can even change the caption of a label in the first UserForm
that's been sitting there.

Check out www.cpearson.com for the Alerter. You might also be interested in
his progress bar.

--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Claudia" wrote in message
...
Hello,

Can anyone provide me with code that will display a
message at the beginning of a macro and at the end when it
finishes running?

Thank You






All times are GMT +1. The time now is 04:16 PM.

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