ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Timed Display Alert (https://www.excelbanter.com/excel-programming/418387-timed-display-alert.html)

J.W. Aldridge

Timed Display Alert
 
Code works fine....

I only need this display to only display for a split second.
Do not want it to require the person to hit ok.



Dim WS As Worksheet
On Error Resume Next
Set WS = Sheets("Tempx")
On Error GoTo 0
If Not WS Is Nothing Then
MsgBox "List updated"
Application.DisplayAlerts = False
WS.Delete
Application.DisplayAlerts = True
Else
MsgBox "No List to update"
End If

JLGWhiz

Timed Display Alert
 
the message box would have to be closed with keystroke commands, which makes
for messy code in my opinion. Why not think along the lines of a UserForm
with a label to convey the message through its cabtion property. That way
you can bring it up with the UserForm1.Show method and use a timer for a
couple of seconds delay then Unload UserForm1.

UserForm1.Show
s = Timer + 2
Do While Timer < s
DoEvents
Loop
Unload UserForm1

"J.W. Aldridge" wrote:

Code works fine....

I only need this display to only display for a split second.
Do not want it to require the person to hit ok.



Dim WS As Worksheet
On Error Resume Next
Set WS = Sheets("Tempx")
On Error GoTo 0
If Not WS Is Nothing Then
MsgBox "List updated"
Application.DisplayAlerts = False
WS.Delete
Application.DisplayAlerts = True
Else
MsgBox "No List to update"
End If



All times are GMT +1. The time now is 01:57 AM.

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