VB中有一个API函数叫Sleep可以实现暂停。或者用下面的自定义过程waitsec来实现暂停。
Sub mmm()
MsgBox "XX"
waitsec 2
MsgBox "XX"
waitsec 2
MsgBox "XX"
End Sub
Private Sub waitsec(ByVal dS As Double)
Dim sTimer As Date
sTimer = Timer
Do
DoEvents
Loop While Format((Timer - sTimer), "0.00") < dS
End Sub
Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:00:05"), "AAA"
Application.OnTime Now + TimeValue("00:00:05"), "BBB"
Application.OnTime Now + TimeValue("00:00:05"), "CCC"
End Sub