bamaisgreat
Well-known Member
- Joined
- Jan 23, 2012
- Messages
- 834
- Office Version
- 365
- Platform
- Windows
Thanks for looking at my post.. I would like to have a user form pop at 2 certain times with a simple message in it and a OK button. If someone has not clicked on the button by a specific time the user form will close so it will allow other macros to run...... I used the code below for msgbox but Could not find a solution on how to close the msgbox at a specific time...
Code:
Sub ShowMsg()
If TimeValue(Now()) > "1:58:00 PM" Then
End If
If TimeValue(Now()) > "1:59:00 PM" Then
Exit Sub
End If
Application.OnTime Now + TimeValue("00:00:01"), "TimedMsgBox"
End Sub
Sub TimedMsgBox()
If TimeValue(Now()) = "1:58:00 PM" Then
MsgBox "SEND FORM AT END OF DAY SHIFT "
End If
If TimeValue(Now()) = "1:59:00 PM" Then
MsgBox "SEND FORM AT END OF DAY SHIFT "
End If
ShowMsg
End Sub