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

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

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

§Ú¹ïVBA³£¤£À´¦bºô¤W§ä¦n¤[§ä¨ì¤@­Ó¤ñ¸û±µªñ§Ú­nªº½d¨Ò
¥i¬O¥L¬O¨C¤ÀÄÁ°O¿ý¤@¦¸
¥i¥H½Ð°ª¤âÀ°§Ú§ï¨C30¬í´N°O¿ý¤@¦¸¶Ü
¤]ÁÂÁ³o¦ì´£¨Ñ½d¨Òªººô¤Í


Option Explicit
Dim LastMin As Integer

Private Sub Workbook_Open()
    Sheets("µ¦²¤°O¿ý").Cells(4, 2) = 10
    LastMin = Minute(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 Minute(Time) <> LastMin 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 = Minute(Time)
    End If
End Sub

¦^´_ 131# fei6999


    ¥h¸Ë¤¸¤jRTD¡F ¥¦ªº½d¨ÒÀÉ´N¦³¡F ¥u­n¦³RTD(¥i§â¥¦¬Ý¦¨DDE)¡A ¦A¨Ó´N¬Oµ{¦¡ªº°ÝÃD¤F

TOP

¦^´_ 130# mlc994800


   ¤¸¤jdde³£¦³´£¨Ñ½d¨Ò!º¦¶^®a¼ÆÀ³¸Ó¦³¤~¹ï

TOP

·Q½Ð°Ý¦pªG·Q­n¤@¶}½L´N¥ý§â¬Q¤Ñ¨C30¬í°O¿ýªº¸ê®Æ²¾°£,À³¸Ó­n¦A¸É¤W«ç¼Ëªºµ{¦¡½X©O??

¥t¥~,·Q½Ð°Ý¤@¤U,¦³¨Ç·Qª¾¹Dªº¸ê°T¦pªGÃÒ¨÷°Ó¨S¦³¨º­Ó«~¶µªº¥N½X¬O¤£¬O´NµLªk¨ú±o©O?
Ä´¦p:¤j½Lªºº¦¶^®a¼Æ..etc.

TOP

¤Ó´Î©Ô  ³o¸Ì²×©ó§ä¨ì§Ú­nªºªF¦è »Å®@:D
¤p¯Î

TOP

¦^´_ 127# areskevin
  1. Option Explicit

  2. Dim LastMin As String

  3. Private Sub Workbook_Open()
  4.     LastMin = "00:01:00"
  5.     Call Timer
  6. End Sub

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

  11. Public Sub Timer()
  12.     Dim Pos As Long, HHMM As Integer, col As Variant
  13.         
  14.     With Sheets("¨C¤À°O¿ý")
  15.         HHMM = Hour(Now) * 100 + Minute(Now)
  16.         If (HHMM < 900 Or HHMM > 1333) Then Exit Sub
  17.    
  18.         .Cells(2, 4) = Now
  19.         Set col = Range(.Range("A5"), .Cells(5, .[A4].End(xlToRight).Column)).Find(Format(.Cells(2, 4), "M/D"), LookIn:=xlValues, LookAt:=xlWhole)
  20.         Pos = .Cells(Rows.Count, col.Column - 1).End(xlUp).Row + 1       '  §¡¥H¨ä¬Û¹ïÀ³¤§·í¤é (col) ¬°°ò·Ç   (Pos = 6 : Long)
  21.         '  Pos = .Range("A" & Rows.Count).End(xlUp).Row + 1
  22.         .Cells(Pos, col.Column - 1) = Format(.Cells(2, 4), "HH:MM:SS")
  23.         .Cells(Pos, col.Column) = .Cells(2, 2)
  24.         .Cells(Pos, col.Column + 1) = .Cells(2, 3)
  25.     End With
  26.    
  27.     Application.OnTime Now + TimeValue(LastMin), "ThisWorkbook.Timer"
  28.     '  Application.OnTime Now + TimeValue("00:01:00"), "ThisWorkbook.Timer"
  29. End Sub
½Æ»s¥N½X
¦¬¦¬ Mail¡I

TOP

¦^´_ 126# c_c_lai

c_c_lai¤j±z¦n^^
­è­è¹Á¸Õ¤F¤@¤U
§âµ{§Ç¥[¤J
ÁÙ¬OµLªk¸õ°Ê
½Ð°Ý¦pªG¬Û¦P»yªk¼g¤J¦b2013ªºexcel¤]¥i¥H¶Ü¡H
¥t¥~¦]¬°§ÚµLªk¤U¸üªþ¥ó¡A
¯à§_³Â·Ð±z§âªþ¥ó±H°eµ¹§Ú©O¡H
[email protected]
§Æ±æ¦³´Â¤@¤é¯à¸òc_c_lai¤j¤@¼Ë
¯à¦^´_¥L¤Hªº°ÝÃD
¸U¤À·PÁÂ

TOP

´£¨Ñ°Ñ¦Ò¡G
¨C¤À°O¿ý(¨C¤ë).rar (11.91 KB)

TOP

¦^´_ 120# areskevin
¬°¤FÅý§A¯à¹ê»ÚÁA¸Ñ "¨C¤À°O¿ý" ªº¹ê°È¼¶¼g¡A
°µ¤F¦¹À³¥Î½d¨Ò¡A´£¨Ñ§A±o¥H¥þ½L©úÁA
¦p¦ó¥h¹ê»Ú±±¨î¨C¤ë¨C¤éªº¯u¹ê¾Þ½L¬ö¿ý¼g¤J
¨Ã¦A§A­ì¥»ªººc·Q¦Ó¾ã²z¥X¨Ó¤§µ{¦¡¹ê»Ú
À³¥Î½d¨Ò¡A§Æ±æ§AÂǦ¹¯àÁ|¤@¤Ï¤T¥[¥Hµo´§¡C
  1. Public Sub Timer()
  2.     Dim Pos As Long, HHMM As Integer, col As Variant
  3.         
  4.     With Sheets("¨C¤À°O¿ý")
  5.         HHMM = Hour(Now) * 100 + Minute(Now)
  6.         If (HHMM < 900 Or HHMM > 1333) Then Exit Sub
  7.    
  8.         .Cells(2, 4) = Now
  9.         '  Set col = Range(.Range("A5"), .Cells(5, .[A5].End(xlToRight).Column)).Find(Format(.Cells(2, 4), "M/D"), LookIn:=xlValues, LookAt:=xlWhole)
  10.         '  Sheets("¨C¤À°O¿ý").[A4].End(xlToRight).Column = 15 : Variant/Long
  11.         '  Sheets("¨C¤À°O¿ý").[A5].End(xlToRight).Column =  2 : Variant/Long  (¦X¨ÖÀx¦s®æ©ö³y¦¨ End(xlToRight).Column §PÂ_¿ù»~)
  12.         Set col = Range(.Range("A5"), .Cells(5, .[A4].End(xlToRight).Column)).Find(Format(.Cells(2, 4), "M/D"), LookIn:=xlValues, LookAt:=xlWhole)
  13.         Pos = .Cells(Rows.Count, col.Column - 1).End(xlUp).Row + 1    '  §¡¥H¨ä¬Û¹ïÀ³¤§·í¤é (col) ¬°°ò·Ç  
  14.         '  Pos = .Range("A" & Rows.Count).End(xlUp).Row + 1
  15.         .Cells(Pos, col.Column - 1) = Format(.Cells(2, 4), "HH:MM:SS")
  16.         .Cells(Pos, col.Column) = .Cells(2, 2)
  17.         .Cells(Pos, col.Column + 1) = .Cells(2, 3)
  18.     End With
  19.    
  20.     '  Application.OnTime Now + TimeValue(LastMin), "ThisWorkbook.Timer"
  21.     Application.OnTime Now + TimeValue("00:01:00"), "ThisWorkbook.Timer"
  22. End Sub
½Æ»s¥N½X

TOP

¦^´_ 120# areskevin
  1. Public Sub Timer()
  2.     Dim Pos As Long, HHMM As Integer, col As Variant
  3.         
  4.     With Sheets("¨C¤À°O¿ý")
  5.         HHMM = Hour(Now) * 100 + Minute(Now)
  6.         If (HHMM < 900 Or HHMM > 1333) Then Exit Sub
  7.    
  8.         .Cells(2, 4) = Now
  9.         '  Time    6/21    6/21    6/22    6/22    6/23    6/23    6/24    6/24    6/25    6/25
  10.         Set col = Range(.Range("A5"), .Cells(5, .[A5].End(xlToRight).Column)).Find(Format(.Cells(2, 4), "M/D"), LookIn:=xlValues, LookAt:=xlWhole)
  11.         Pos = .Range("A" & Rows.Count).End(xlUp).Row + 1
  12.         .Cells(Pos, 1) = Format(.Cells(2, 4), "HH:MM:SS")
  13.         .Cells(Pos, col.Column) = .Cells(2, 2)
  14.         .Cells(Pos, col.Column + 1) = .Cells(2, 3)
  15.     End With
  16.    
  17.     '  Application.OnTime Now + TimeValue(LastMin), "ThisWorkbook.Timer"
  18.     Application.OnTime Now + TimeValue("00:01:00"), "ThisWorkbook.Timer"
  19. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¦h°µ¦h±o¡C¤Ö°µ¦h¥¢¡C
ªð¦^¦Cªí ¤W¤@¥DÃD