- ©«¤l
- 1018
- ¥DÃD
- 15
- ºëµØ
- 0
- ¿n¤À
- 1058
- ÂI¦W
- 0
- §@·~¨t²Î
- win7 32bit
- ³nÅ骩¥»
- Office 2016 64-bit
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ®ç¶é
- µù¥U®É¶¡
- 2012-5-9
- ³Ì«áµn¿ý
- 2022-9-28
|
¦^´_ 3# owen06
Application.OnTime t2, "AutoCopy",,false ³oÓ»yªk¤@ª½¤£ª¾¹D¸Ó«ç»òÀ³¥Î¡C
¥i¥Î¥þ°ìÅܼƬö¿ý®É¶¡¡A¥H¨ú®ø¸Ó®É¶¡ªº±Æµ{- Private tNext As Date
- Sub StartButton()
- On Error Resume Next
- StopButton
- On Error GoTo 0
- MyLoop TimeValue("18:00:00")
- End Sub
- Public Sub StopButton()
- Application.OnTime tNext, "MyLoop", , False
- End Sub
- Sub MyLoop(Optional tStart)
- Const MIN_INTERVAL = 1 '¶¡¹j®É¶¡
-
- If Not IsMissing(tStart) Then
- tNext = tStart
- Application.OnTime tNext, "MyLoop"
- Else
- tNext = tNext + TimeSerial(0, MIN_INTERVAL, 0)
- Application.OnTime tNext, "MyLoop"
- MyCopyFunc 'call your copy function
- End If
- End Sub
- Sub MyCopyFunc()
- 'The timing cost of MyCopyFunc should less than the time of INTERVAL
- 'Copy here
- End Sub
½Æ»s¥N½X |
|