- ©«¤l
- 181
- ¥DÃD
- 5
- ºëµØ
- 0
- ¿n¤À
- 197
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- 2000
- ¾\ŪÅv
- 20
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2014-3-9
- ³Ì«áµn¿ý
- 2024-4-29
|
Sub timestock()
' Application.EnableEvents = False
Application.ScreenUpdating = False
If TimeValue(The_Time) > TimeValue(Time) Then '¹w¨¾ ¤W¤@¦¸ OnTime©|¥¼°õ¦æ,¦A«×°õ¦æ¤@¦¸OnTime
Exit Sub
End If
' Time '**** °õ¦æªºOnTime
' The_Time '**** °õ¦æ¤U¤@¦¸OnTime
'------------------------------------------------------------------------------------------
Dim TIMEB, AG
TIMEB = 10
AG = (TimeValue(Now) * 60 * 60 * 24) - (Range("B2") * 60 * 60 * 24) '´«¬°¬í
If AG > TIMEB Then
On Error Resume Next
Application.OnTime The_Time, "timestock", Schedule:=False
If Err Then
Application.OnTime The_Time, "timestock", Schedule:=True
End If
The_Time = 0
Range("B2") = TimeValue(Now)
MsgBox "Ǧ]"
timestock
Exit Sub
End If ' 333333
'--------------------------------------------------------------------------------
my = #12:00:01 AM#
The_Time = Time + my
Application.OnTime The_Time, "timestock"
[a2] = [a2] + 1
Range("a1").Value = Format(The_Time, "hh:mm:ss")
End Sub |
|