- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¥»©«³Ì«á¥Ñ c_c_lai ©ó 2012-5-31 20:33 ½s¿è
¦^´_ c_c_lai
CC¤j©êºp,§Ú§V¤Oª¦¤å¤]¬Ý§¹±zªº½d¨ÒÀÉ®×,¦ý¯uªºµLªk¹ïÀ³×§ï¦¨§Ú¦Û¤vªº»Ý¨D, ¤@¬¤£³qªü ...
pipe µoªí©ó 2012-5-30 15:53
¹ê¦b¬O¯uªA¤F§A¡A·Q·QÁÙ¬OÀ°§A¼g¦n¤F¡C- Option Explicit
- Dim timerEnabled As Boolean
- Dim Pos As Integer ' ±N¨C¹j "¦h¤Ö®É¶¡" ³B²z®É¬q¡A²¾¨ì¦¹³B¨Ó³B²z¡C
- Private Sub Workbook_Open()
- Pos = Sheets("sheet1").Range("C" & Rows.Count).End(xlUp).Row
- timerEnabled = False
- Call timerStart ' µ{¦¡¤@±Ò©l¡A«K¥h¦Û°Ê°õ¦æ timerStart
- End Sub
- Private Sub Workbook_BeforeClose(Cancel As Boolean)
- On Error Resume Next
- Application.OnTime Now + TimeValue("00:00:01"), "ThisWorkbook.Timer", , False
-
- Me.Save
- End Sub
- Public Sub Timer()
- On Error Resume Next
- If (TimeValue(Now) > Sheets("sheet1").Range("AV2").Value) Then Exit Sub
-
- If (TimeValue(Now) >= Sheets("sheet1").Range("AV1").Value) Then ' ¶}½L¡B¦¬½L®É¬q³]©w
- ' ½L¤¤³B²z¡A±N¸ê®Æ¶×¤J¼g¤J¤u§@ªí³æ¤ºÀx¦s¡C
-
- With Sheets("sheet1")
- Pos = Pos + 1 ' ±NÅܰʦ渹¥[¤@¦æ
-
- .Cells(Pos, 1).Value = Date ' ¤é´Á
- .Cells(Pos, 2).Value = Time ' ®É¶¡
- .Cells(Pos, 3).Resize(1, 12) = .Range("C8:N8").Value ' ¤j§¡¡B¤j®t¡B´Á§¡¡B´Á®t¡B¥x«ü¡B°ªÂI¡B§CÂI¡B¤¤Ãö¡B»ù®t¡B®¶ºÖ¡B¼¯¥x¡B¥[Åv
-
- .Cells(2, 49).Value = Pos ' AW2
- End With
- End If
-
- Call timerStart
- End Sub
-
- Sub timerStart()
- If timerEnabled Then
- Application.OnTime (Now + Sheets("sheet1").Range("AW1").Value), "ThisWorkbook.Timer"
- Else
- timerEnabled = True
-
- ' ¨t²Îè³s¤W DDE ¦Ü¸ê®Æ¶×¤JExcel¤u§@ªí³æ¡A¶·¦³¤@Ó½w½Ä®É¬q¡A
- ' ³o®É¦pªG°¨¤W¥h§ì¨úDDE¸ê®Æ¡A·|¦³«¬ºA¤£²Åªº¿ù»~°T®§²£¥Í¡A¨Ã¤¤Â_°õ¦æ§Çªº§@·~¡C
- Application.OnTime (Now + TimeValue("00:00:05")), "ThisWorkbook.Timer"
- End If
- End Sub
½Æ»s¥N½X °Å¤U«áª½±µ¶K¤J¨ì ThisWorkbook µ{¦¡°Ï´N OK ¤F¡C |
-
-
a.rar
(74 Bytes)
|