Status Message

  • Thread starter Thread starter Ray Batig
  • Start date Start date
R

Ray Batig

Is there a simple way to pop up a message type box with a variable message
that would stay around for two seconds and then disappear? I would like to
not stop the main macro from running during the time the box is in view. I
have some very long procedures that I would like to show some simple
indication of progress.

Merry Christmas. Thanks in advance for your help!

Ray
 
Ray,

In Excel 2000 and later, you can use a userform to display the
message and keep code running while the form is displayed. For
example,

UserForm1.Show vbModelsss


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Thanks Chip,

I built the following code to implement the concept. However, the userform
pops up as an outline with a visible title. I can't see the message. Any
ideas on how to fix? This is a very nice way to show where you are.

Regards,
Ray

Sub PopUpInfo(PuMsg)
' this pops up an information box for for 2 seconds
Dim StartTime As Long

UserForm1.ListBox1.Clear ' clear box and load data
With UserForm1.ListBox1
.AddItem (PuMsg)
End With
UserForm1.Show vbModeless
' hold userfrom for specified seconds
StartTime = Second(Now())

Do While Second(Now()) - StartTime < 3
Loop

Unload UserForm1
End Sub
 
Ray,

Use a DoEvents and Repaint within your loop. E.g.,

UserForm1.Show vbModeless
Do Until Whatever
' your code
DoEvents
UserForm1.Repaint
Loop


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Back
Top