VBA/Excel/Access/Word/Date Functions/TimeSerial
Версия от 16:33, 26 мая 2010; (обсуждение)
Scheduling a Macro to Run x Minutes in the Future
Sub ScheduleAnything()
WaitHours = 0
WaitMin = 2
WaitSec = 30
NameOfScheduledProc = "CaptureData"
NextTime = time + TimeSerial(WaitHours, WaitMin, WaitSec)
Application.OnTime EarliestTime:=NextTime, Procedure:=NameOfScheduledProc
End Sub
TimeSerial( returns AM
Sub timeDemo()
Debug.Print TimeSerial(9, 0, 0)
End Sub
TimeSerial(hour, minute, second) returns a Variant/Date containing the time for the specified hour, minute, and second
Sub dateDemo14()
Debug.Print TimeSerial(11, 12, 13)
End Sub