LZ这么写试试:
Dim currentTime
currentTime=Timer
If (currentTime > DateValue("9:00:00") and currentTime < DateValue("9:20:00")) Then
MsgBox "aa"
Else
MsgBox "bb"
End If
Dim currentTime
currentTime=time()
msgbox currentTime
If (currentTime > timevalue("14:00:00") and currentTime < timevalue("15:20:00")) Then
MsgBox "aa"
Else
MsgBox "bb"
End If
Dim currentTime
currentTime=time()
msgbox currentTime
If (currentTime > timevalue("14:00:00") and currentTime < timevalue("15:20:00")) Then
MsgBox "aa"
Else
MsgBox "bb"
End If