½Ð°Ý°ª¤ân±N¥H¤UDDE ¨C¤ÀÄÁ°O¿ý§ï¬°30¬í¦Û°Ê°O¿ý¤@¦¸n«ç§ï
- ©«¤l
- 48
- ¥DÃD
- 2
- ºëµØ
- 0
- ¿n¤À
- 64
- ÂI¦W
- 0
- §@·~¨t²Î
- xp
- ³nÅ骩¥»
- office 2000
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- TAIPEI
- µù¥U®É¶¡
- 2011-4-16
- ³Ì«áµn¿ý
- 2025-2-16
|
¥»©«³Ì«á¥Ñ a8350070 ©ó 2012-5-26 11:04 ½s¿è
¸ÕµÛ¦bÅÜ°Ê´T«×³Ì¤pªº«e´£¤Uקï
Option Explicit
Dim LastMin As Long
Private Sub Workbook_Open()
Sheets("µ¦²¤°O¿ý").Cells(4, 2) = 10
LastMin = Hour(Time) * 3600 + Minute(Time) * 60 + Second(Time)
Call Timer
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:01"), "ThisWorkbook.Timer", , False
End Sub
Public Sub Timer()
Dim Pos As Integer, i As Integer, RangeStr As String
On Error Resume Next
Application.OnTime Now + TimeValue("00:00:01"), "ThisWorkbook.Timer" '¨C¬íÅã¥Ü
Sheets("µ¦²¤°O¿ý").Cells(3, 2) = Time '±N®É¶¡show¦Üµ¦²¤ªºb3Äæ¦ì
Dim HHMM As Integer
HHMM = Hour(Time) * 100 + Minute(Time)
If (HHMM < 845 Or HHMM > 1345) Then Exit Sub 'Àç·~®É¶¡¤~°õ¦æ
If Hour(Time) * 3600 + Minute(Time) * 60 + Second(Time) > LastMin + 30 Then '¶}©l«á°µ
With Sheets("µ¦²¤°O¿ý")
.Cells(4, 2) = .Cells(4, 2) + 1 '±NÅܰʦ渹¥[¤@¦æ
Pos = .Cells(4, 2)
.Cells(Pos, 1) = Time
.Cells(Pos, 2) = .Cells(2, 2)
.Cells(Pos, 3) = .Cells(2, 3)
.Cells(Pos, 4) = .Cells(2, 4)
.Cells(Pos, 5) = .Cells(2, 5)
.Cells(Pos, 6) = .Cells(2, 6)
.Cells(Pos, 7) = .Cells(2, 7)
.Cells(Pos, 8) = .Cells(2, 8)
.Cells(Pos, 9) = .Cells(2, 9)
.Cells(Pos, 10) = .Cells(2, 10)
End With
LastMin = Hour(Time) * 3600 + Minute(Time) * 60 + Second(Time)
End If
End Sub |
|
My Blog
http://blog.xuite.net/a8350070
|
|
|
|
|