ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to display a message box (https://www.excelbanter.com/excel-programming/281526-how-display-message-box.html)

Salman[_2_]

How to display a message box
 
I need to have a message box that says "Please wait" show
up while code executes. Used to be a simple thing in XL97.
Please tell me how to make it show up.

Thank you.

Cesar Zapata[_2_]

How to display a message box
 
The best way I have found is this. Put a Image in your worksheet. and name
it Please Wait or whatever. the run this code. The way I usually do it is
I create a Userform with all the stuff I want the I take a screenshot and
paste it in my worksheet.


Dim MySel As Object




Sub Show_Please_Wait()

On Error Resume Next

Dim VR As Range, MyShape As Shape
Set VR = ActiveWindow.VisibleRange
Set MyShape = Sheet1.Shapes("PleaseWait")
Set MySel = Selection

MyShape.Copy
T = VR.Top + VR.Height / 2 - MyShape.Height / 2
L = VR.Left + VR.Width / 2 - MyShape.Width / 2

ActiveSheet.Paste
With ActiveSheet.Shapes("PleaseWait")
.Top = T
.Left = L
End With

VR.Resize(1, 1).Select

End Sub

Sub Hide_Please_Wait()

On Error Resume Next
ActiveSheet.Shapes("PleaseWait").Delete
Application.ScreenUpdating = True
MySel.Select
End Sub







"Salman" wrote in message
...
I need to have a message box that says "Please wait" show
up while code executes. Used to be a simple thing in XL97.
Please tell me how to make it show up.

Thank you.





All times are GMT +1. The time now is 02:35 PM.

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