- ©«¤l
- 2
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 84
- ÂI¦W
- 0
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Taiwan
- µù¥U®É¶¡
- 2010-9-3
- ³Ì«áµn¿ý
- 2011-8-22
|
¥»©«³Ì«á¥Ñ susamws ©ó 2010-9-3 16:49 ½s¿è
¦U¦ì«e½ú±z̦n
º¥ý¥ý·PÁ¨F¤j¤À¨Éªº¤å³¹»P°Ñ¦Ò. ¤~¦³¶i¤@¨BªºÁA¸Ñ
°ÝÃD¡G¥Ñ©ósheet1 ¦³A1 dde¨Ó·½, ·Q¦A¼W¥[§Oªº¨Ó·½¦ÜB2 C2..... ¨Ã¦P¼Ë½Æ»s¨ìsheet2 C, D¸Ì±
½Ð°Ý«e½úÌ ¸Ó»yªk¸Ó«ç»ò¤U©O¡H ¸Õ¤F«Ü¦h¼gªk³£¿ù»~...
¦p¤UÂŦâ½X¡G
Option Explicit
Const CTIME As String = "0:0:3"
Private nextruntime As Date
Private timerisrunning As Boolean
Sub Start_Timer()
If Not timerisrunning Then
nextruntime = Now() + TimeValue(CTIME)
timerisrunning = True
Application.OnTime EarliestTime:=nextruntime, _
Procedure:="GetData", Schedule:=True
End If
End Sub
Private Sub GetData()
Dim rng As Range
Set rng = Sheets("Sheet2").Range("B65536").End(xlUp).Offset(1, 0)
rng = Sheets("Sheet1").Range("A1")
rng.Offset(0, -1) = Time
timerisrunning = False
Start_Timer
End Sub
Sub Stop_Timer()
If timerisrunning Then
Application.OnTime EarliestTime:=nextruntime, _
Procedure:="GetData", Schedule:=False
timerisrunning = Not timerisrunning
End If
End Sub
Private Sub auto_close()
Stop_Timer
End Sub |
|