½Ð°Ý°ª¤ân±N¥H¤UDDE ¨C¤ÀÄÁ°O¿ý§ï¬°30¬í¦Û°Ê°O¿ý¤@¦¸n«ç§ï
- ©«¤l
- 48
- ¥DÃD
- 14
- ºëµØ
- 0
- ¿n¤À
- 62
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- office2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-5-25
- ³Ì«áµn¿ý
- 2022-4-23
|
½Ð°Ý°ª¤â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 |
|
|
|
|
|
|
- ©«¤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
|
¦^´_ 1# xu123
´N¥H§A¤â¤W®×¨Ò¨Ó°Q½×ªº¸Ü¡A§A¥un±N "00:00:01" (¨C¤@¬í)
קאּ "00:00:30" (¨C¤T¤Q¬í) «K§¹¦¨¤F¡I |
|
|
|
|
|
|
- ©«¤l
- 48
- ¥DÃD
- 14
- ºëµØ
- 0
- ¿n¤À
- 62
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- office2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-5-25
- ³Ì«áµn¿ý
- 2022-4-23
|
ÁÂÁÂc_c_lai ¤jªº¦^´_
¤U©P¶}½L¦A¸Õ¸Õ¬Ý |
|
|
|
|
|
|
- ©«¤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
|
¦^´_ 3# xu123
¤£¶·µ¥¶}½L¡A§A¥un¶}±Ò¸ÓExcel ªí³æ¡A©ó 8:45 «áÆ[¹î¨C¹j30¬í¬O§_·|¼g¤J¤@µ§¬ö¿ý¡A
µª®×«K§Yª¾¾å¡C |
|
|
|
|
|
|
- ©«¤l
- 51
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 59
- ÂI¦W
- 0
- §@·~¨t²Î
- VISTA
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-4-1
- ³Ì«áµn¿ý
- 2018-5-17
|
¦^´_ xu123
¤£¶·µ¥¶}½L¡A§A¥un¶}±Ò¸ÓExcel ªí³æ¡A©ó 8:45 «áÆ[¹î¨C¹j30¬í¬O§_·|¼g¤J¤@µ§¬ö¿ý¡A
µª®×«K ...
c_c_lai µoªí©ó 2012-5-25 21:14
½Ð°Ýn§ïþ¨à?
Application.OnTime Now + TimeValue("00:00:30"), "ThisWorkbook.Timer" '¨C¬íÅã¥Ü
§Ú§ï³oÃä«á ®É¶¡´N¤£°Ê¤]¤£°O¿ý¤F?
ÁÂÁ ·P®¦ |
|
|
|
|
|
|
- ©«¤l
- 48
- ¥DÃD
- 14
- ºëµØ
- 0
- ¿n¤À
- 62
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- office2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-5-25
- ³Ì«áµn¿ý
- 2022-4-23
|
c_c_lai ¤j
¸Õ¹L¤F¤£¦æ£z
``§Ú§ï¶}½L®É¶¡¥h´ú¸Õ
ÁÙ¬O¤@¤ÀÄÁ°O¤@¦¸ |
|
|
|
|
|
|
- ©«¤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
|
¦^´_ 6# xu123
½Ðªþ¤WÀɮץѧڳo¤è¨ÓÆ[¹î¡A¦]¬°¨º¥»¨Ó´N¥i¦æªº¡A
§_«h§Aªº "00:00:01" ¥çµLªk°õ¦æ¡C |
|
|
|
|
|
|
- ©«¤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
|
¦^´_ 6# xu123
ªþ¤W¹Ï¤ù¥H¤Îµ{¦¡½X¨Ñ§A¹ê°È°Ñ¦Ò¡G
¤@¡B DDE ¨C¤ÀÄÁ°O¿ý§ï¬°30¬í¦Û°Ê°O¿ý¤@¦¸n«ç§ï [קï]
- Option Explicit
- Dim counter As Single ' ¬°¥[²`¦L¶H¡A¥Î¥¦¨ÓÅã¥Üµ{¦¡¦³§_¦b¹B¦æ³B²z
- Private Sub Workbook_Open()
- counter = 0
- Call timerStart ' ·í¶}±Ò¥» Excel ÀɮסAµ{¦¡«h¦Û°Ê°õ¦æ timerStart µ{¦¡¬q¡C
- End Sub
- Sub timerStart()
- ' ¥»½d¨Ò³]©w®É¶¡¬O±q¨C¤é¤KÂI¥|¤Q¤¤À¶}©l°_ºâ¡A¨C¹j 30 ¬í«K·|¦Û°Ê¥h°õ¦æ ThisWorkbook µ{¦¡°Ï°ì¤ºªº ExeSelf¡C
- ' ¦pªGı±oµ¥¤Ó¤[¤F¡A¤]¥i¥H¥h²§°Ê®É¬q¡C¨Ò¦p: "00:00:01"(¨C¹j 1 ¬í)¡B"00:00:10"(¨C¹j 10 ¬í)¡B"00:00:20"(¨C¹j 20 ¬í) µ¥µ¥¡C
- If (TimeValue(Now) > TimeValue("08:45:00")) Then Application.OnTime (Now + TimeValue("00:00:30")), "ThisWorkbook.ExeSelf"
- End Sub
- Sub ExeSelf()
- counter = counter + 1 ' counter ·|³v¦¸¥[¤@
- [F8].Value = counter ' 08:45 «á¨C¹j 30 ¬í¡A½ÐÆ[¹î F1 Äæ¦ì¼Æ¦r¬O§_·|²§°Ê¡H
- Call timerStart ' µ{¦¡¤§©Ò¥H·|¤ÏÂаõ¦æ¡A´N¦b©ó¥»¦æ¦Û°Ê¦A¥h¦^ÀY©I¥s°õ¦æ timerStart µ{¦¡¬q¤@¦¸¤§¬G¡C
- End Sub
½Æ»s¥N½X ¤G¡B ¦hªÅ¤O¹D (O/H/L/C) ¹ê»Ú¤§µ{¦¡¹B§@µ{¦¡½X¡A½Ð²Ó¤ßºÝÙ¡C- Option Explicit
- Dim timerEnabled As Boolean '
- Dim counter As Single ' ¥Ü½d¥Îp¼Æ¾¹
- Dim Ov As Single, Hv As Single, Lv As Single, Cv As Single As Single ' ¶}½L»ù¡B³Ì°ª»ù¡B³Ì°ª»ù¡B¦¬½L»ù(¦¨¥æ»ù) µ¥³]©w¤§ÅܼơC
- Dim turnKey As Integer ' §PÂ_¨C¤@½ü°j¤W¦CÅܼƪì©lȤ§³]©w¡C
- Dim nums As Integer ' ±N¨C¹j "¦h¤Ö®É¶¡" ³B²z®É¬q¡A²¾¨ì¦¹³B¨Ó³B²z¡C
- Private Sub Workbook_Open()
- counter = 0
- nums = 30 ' ³]©w¨C¹j 30 ¬í³B²z®É¬q¡A¥ç¥i§ó§ï¦¨ 10 (¨C¹j 10 ¬í)¡B20 (¨C¹j 20 ¬í)µ¥µ¥¡C
- ' ¦¹³B¤£«Øij¨Ï¥Î 1 ¬í®É¬q¨Ó³B²z¡A¦]¬°ÁÙn¥h¨D¥X¶}½L¡B³Ì°ª¡B³Ì§C¡B¦¨¥æ»ù¡C
- timerEnabled = False
- Call timerStart ' µ{¦¡¤@±Ò©l¡A«K¥h¦Û°Ê°õ¦æ timerStart
- End Sub
- Sub timerStart()
- turnKey = 0 ' ¨C¤@½ü°j½L¤¤ªì©lȤ§³]©w¡C
- If timerEnabled Then
- Application.OnTime (Now), "ThisWorkbook.ExeSelf"
- Else
- ' ¨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.ExeSelf"
- End If
- End Sub
- Sub ExeSelf()
- timerEnabled = True
- If IsError(Sheets("¤u§@ªí1").Range("E5").Value) Then ' °²³] E5 Äæ¦ì¬°¦hªÅ¤O¹D
- Cv = 0
- Else
- Cv = Sheets("¤u§@ªí1").Range("E5").Value ' ¦hªÅ¤O¹D¦¨¥æ»ù
- End If
-
- If (turnKey = 0 Or Ov = 0) Then ' ·í turnKey Ȭ°0¡Aªí¥Ü¨ä¬°ªì©lȳ]©w¡C¬°¦Ò¶q¨t²Îè³s¤W DDE¡A
- ' ¦³®É¦b²Ä¤@®Ú¼ÆȲ£¥Í®É Ov = Cv È¥i¯à¬° 0 (IsError()ªºª¬ºA)¡C
- Ov = Cv ' ¦hªÅ¤O¹D¶}½L»ùªì©lȳ]©w
- Hv = Cv ' ¦hªÅ¤O¹D³Ì°ª»ùªì©lȳ]©w
- Lv = Cv ' ¦hªÅ¤O¹D³Ì§C»ùªì©lȳ]©w
- End If
-
- turnKey = turnKey + 1
-
- If (Cv > Hv) Then Hv = Cv ' §PÂ_¦hªÅ¤O¹D³Ì°ª»ù
- If (Cv < Lv) Then Lv = Cv ' §PÂ_¦hªÅ¤O¹D³Ì§C»ù
- counter = counter + 1
- [F1].Value = counter ' 08:45 «á¨C¹j 30 ¬í¡A½ÐÆ[¹î F1 Äæ¦ì¼Æ¦r¬O§_·|²§°Ê¡H
-
- If (turnKey < nums) Then
- Application.OnTime (Now + TimeValue("00:00:01")), "ThisWorkbook.ExeSelf"
- Else
- If (Cv > 0) Then Call Timer
- Call timerStart
- End If
- End Sub
- Sub Timer()
- Dim str As String
-
- If (TimeValue(Now) >= TimeValue("08:45:00") And TimeValue(Now) <= TimeValue("13:46:01")) Then ' ¶}½L¡B¦¬½L®É¬q³]©w
- ' ½L¤¤³B²z¡A±N¸ê®Æ¶×¤J¼g¤J¤u§@ªí³æ¤ºÀx¦s¡C
- End If
- End Sub
½Æ»s¥N½X ½Ð¯d·N¦¹¨â¤äµ{¦¡ªº¼gªk¤W¤§®t²§¡A§Ú³£ºÉ¶q¤@¤@¥[¥H»¡©ú¬°¦ó¦p¦¹¡A¬Û«H¹ï§A·|¦³§U¯q¡C
§Ú̦b¤H¥Í®Èµ{¤W³£¬O±q¤£ª¾¦ÓÀòª¾¤¤¦¨ªøªº¡A¥un¦³¤ß³£¥i¥H¦¨¥\ªº¡C |
|
|
|
|
|
|
- ©«¤l
- 48
- ¥DÃD
- 14
- ºëµØ
- 0
- ¿n¤À
- 62
- ÂI¦W
- 0
- §@·~¨t²Î
- win7
- ³nÅ骩¥»
- office2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-5-25
- ³Ì«áµn¿ý
- 2022-4-23
|
|
|
|
|
|
|
- ©«¤l
- 51
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 59
- ÂI¦W
- 0
- §@·~¨t²Î
- VISTA
- ³nÅ骩¥»
- office 2003
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-4-1
- ³Ì«áµn¿ý
- 2018-5-17
|
¦^´_ xu123
ªþ¤W¹Ï¤ù¥H¤Îµ{¦¡½X¨Ñ§A¹ê°È°Ñ¦Ò¡G
¤@¡B DDE ¨C¤ÀÄÁ°O¿ý§ï¬°30¬í¦Û°Ê°O¿ý¤@¦¸n«ç§ï [קï] ...
c_c_lai µoªí©ó 2012-5-26 09:44
·PÁÂc_c_lai ¤j³o»ò¸Ô²Ó¥Î¤ßªº¸Ñ»¡
¤S¶i¤@¨B¾Ç²ß¤F
¨Ó´ú¸Õ¬ã¨s¤@¤U
·P®¦¦A·P®¦ |
|
|
|
|
|
|