• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Is there VBA to provide a time gap between 2 different Msgboxes?

Frncis

Member
I currently am using a VBCritical Msgbox to inform a user, & acknowledge the receipt of the message. I am trying to find code to allow a VBInformation box to pop up 3 sec after the Critical box disappears. I only need the boxes to appear when workbook is opened, so the code is on Thisworkbook.
Here is the current code:

Code:
Private Sub workbook_open()

    'Activates on referral sheet when workbook is opened.
    Worksheets("TOC").Activate
    Application.Speech.Speak "  Enter    Consults.  on the Referrals   sheet.  Enter    Community  Partner Data    (O.V.R., etc.)   on Walk Ins sheet!! Check   Referrals first   to see  if a consult  was placed.    If YES do not make the entry on Walk Ins sheet!! ", SpeakAsync:=True
     Application.Wait (Now + TimeValue("00:00:02"))
    MsgBox "Enter Consults on the Referrals sheet." & vbCrLf & _
    "Enter Community Partner Data  (OVR, etc.) on Walk Ins sheet!!" & vbCrLf & _
    "Check Referrals first to see if a consult was placed." & vbCrLf & _
    "If YES do not make the entry on Walk Ins sheet. ", vbCritical, "Vocational Services Database - " & ActiveSheet.Name

     End Sub
I have found code to close automatically or after a set time, but not to open like I am trying.
 
Last edited by a moderator:
Problem solved. I am sorry that I wasted the groups time. For future readers here is the code:

Code:
Private Sub workbook_open()
'Part of the code to insert dates.
   On Error Resume Next
    Dim NewControl As CommandBarControl
    Application.OnKey "+^{C}", "Module1.OpenCalendar"
    Application.CommandBars("Cell").Controls("Insert Date").Delete
    Set NewControl = Application.CommandBars("Cell").Controls.Add
    With NewControl
       .Caption = "Insert Date"
       .OnAction = "Module1.OpenCalendar"
       .BeginGroup = True
    End With
    
    'Activates on referral sheet when workbook is opened.
    ' Message 1
    Worksheets("TOC").Activate
    Application.Speech.Speak "  Enter    Consults.  on the Referrals   sheet.  Enter    Community  Partner Data    (O.V.R., etc.)   on Walk Ins sheet!! Check   Referrals first   to see  if a consult  was placed.    If YES do not make the entry on Walk Ins sheet!! ", SpeakAsync:=True
     Application.Wait (Now + TimeValue("00:00:02"))
    MsgBox "Enter Consults on the Referrals sheet." & vbCrLf & _
    "Enter Community Partner Data  (OVR, etc.) on Walk Ins sheet!!" & vbCrLf & _
    "Check Referrals first to see if a consult was placed." & vbCrLf & _
    "If YES do not make the entry on Walk Ins sheet. ", vbCritical, "Vocational Services Database - " & ActiveSheet.Name

     'Message 2.
     MsgBox " If today is the 1st of the month, or close the first go to Date Change - Other"
         
       Ans = MsgBox(Msg, vbYesNo, "Do you want to Go to Date Change - Other?")
          
         Select Case Ans
         
    Case vbYes
Sheets("Month_Source").Select
End Select
     End Sub
 
Back
Top