ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

½Ð°Ý°ª¤â­n±N¥H¤UDDE ¨C¤ÀÄÁ°O¿ý§ï¬°30¬í¦Û°Ê°O¿ý¤@¦¸­n«ç§ï

¥»©«³Ì«á¥Ñ 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

TOP

¦^´_ 9# xu123
  1. Option Explicit
  2. Dim LastMin As String          ' §ó§ï¬°¶¡¹j®É¬q³]©w

  3. Private Sub Workbook_Open()
  4.     Sheets("µ¦²¤°O¿ý").Cells(4, 2) = 10     ' «O¯d§A¤§«eªº³]©w¡A¨C¦¸¤@¶}±ÒExcel³£­«·s¶}©l
  5.     LastMin = "00:00:30"          ' ¨C¹j 30 ¬íªº®É¬q³]©w¡C¦p»Ý¥H¤@¤ÀÄÁ°µ³B­ù¡A«h½Ð­×¥¿¬° "00:01:00"
  6.    
  7.     Call Timer
  8. End Sub

  9. Private Sub Workbook_BeforeClose(Cancel As Boolean)
  10.     On Error Resume Next
  11.     Application.OnTime Now + TimeValue("00:00:01"), "ThisWorkbook.Timer", , False
  12. End Sub


  13. Public Sub Timer()
  14.     Dim Pos, i, HHMM As Integer, RangeStr As String
  15.         
  16.     On Error Resume Next
  17.     Sheets("µ¦²¤°O¿ý").Cells(3, 2) = Time '±N®É¶¡show¦Üµ¦²¤ªºb3Äæ¦ì
  18.    
  19.     HHMM = Hour(Time) * 100 + Minute(Time)
  20.     If (HHMM < 845 Or HHMM > 1345) Then Exit Sub 'Àç·~®É¶¡¤~°õ¦æ
  21.         
  22.     With Sheets("µ¦²¤°O¿ý")
  23.         .Cells(4, 2) = .Cells(4, 2) + 1 '±NÅܰʦ渹¥[¤@¦æ
  24.         Pos = .Cells(4, 2)
  25.         .Cells(Pos, 1) = Time
  26.         .Cells(Pos, 2) = .Cells(2, 2)
  27.         .Cells(Pos, 3) = .Cells(2, 3)
  28.         .Cells(Pos, 4) = .Cells(2, 4)
  29.         .Cells(Pos, 5) = .Cells(2, 5)
  30.         .Cells(Pos, 6) = .Cells(2, 6)
  31.         .Cells(Pos, 7) = .Cells(2, 7)
  32.         .Cells(Pos, 8) = .Cells(2, 8)
  33.         .Cells(Pos, 9) = .Cells(2, 9)
  34.         .Cells(Pos, 10) = .Cells(2, 10)
  35.     End With
  36.    
  37.     Application.OnTime Now + TimeValue(LastMin), "ThisWorkbook.Timer"  ' ¨C LastMin °õ¦æ¤@¦¸
  38. End Sub
½Æ»s¥N½X
¯¬¬P´Á°²¤é´r§Ö¡I
¦Û°Ê°O¿ý¨C¤ÀÄÁ©e¶R½æ§¡­È-½d¨Ò.rar (12.31 KB)

TOP

´ú¸Õ¥i¥H¨Ï¥Î¤F
ÁÂÁÂa8350070  ©Mc_c_lai
§A­Ì¯uªº«Ü¼ö¤ß

TOP

ªì¨Ó¨ì³o¸Ì ¯u¬O°ª¤â¦p¶³
¬Ý¨Ó¥i±o¦n¦n¾Ç²ß¤F

TOP

·PÁÂc_c_lai ¤j³o»ò¸Ô²Ó¥Î¤ßªº¸Ñ»¡

TOP

ÁÂÁÂa8350070  ©Mc_c_lai ¥Î¤ßªº¸Ñ»¡
stock

TOP

¥»©«³Ì«á¥Ñ mead ©ó 2012-6-24 10:34 ½s¿è
¸ÕµÛ¦bÅÜ°Ê´T«×³Ì¤pªº«e´£¤U­×§ï

Option Explicit
Dim LastMin As Long

Private Sub Workbook_Open ...
a8350070 µoªí©ó 2012-5-26 11:03

If Hour(Time) * 3600 + Minute(Time) * 60 + Second(Time) > LastMin + 30 Then '¶}©l«á°µ
³o¼Ë§ï  ¨ä­n°O¿ýªº®É¶¡³]©w­n´î1
¦p30¬í  ´N­n¥[29¦Ó«D30

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2012-6-25 08:42 ½s¿è

¦^´_ 17# mead
ªþ¤W¤@­Ó¥i¥HÀH§A»Ý¨D²§°Êªº "¦Û°Ê°O¿ý¨C¤ÀÄÁ©e¶R½æ§¡­È"¡A
¥H«á§A´N¨S¦³·Ð´oªº¨Æ¤F¡I
¦Û°Ê°O¿ý¨C¤ÀÄÁ©e¶R½æ§¡­È.rar (13.96 KB)

P.S. ½Ð±N Time() ¸Ìªº             .Cells(21, 2).Offset(0).Resize(, 9) = .[B12:J12].Value
§ó§ï¦¨                                      .Cells(Pos, 2).Offset(0).Resize(, 9) = .[B2:J2].Value

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2012-6-25 17:34 ½s¿è

¦^´_ 19# mead
§ä¨ì¤F¡A¤w  E-Mail ¹L¥h¤F¡I

TOP

¦^´_ 20# c_c_lai


    c_c_lai ¤j¤j,§Ú¤]»Ý­n³o­ÓÀÉ®×,¦]Åv­­¤£¨¬µLªk¤U¸ü
¥i§_±H¨ì§Úªº«H½c,·PÁ¼ö¤ß¤À¨É
stock

TOP

        ÀR«ä¦Û¦b : ¦³®É·í«äµL®É­W¡A¦n¤Ñ­n¿n«B¨Ó³¡C
ªð¦^¦Cªí ¤W¤@¥DÃD