- ©«¤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
|
¦^´_ 11# ajagow
Äæ¦ìªº½T»{«D±`«n¡A§Aªº»yªk§Úµy¥[קï¤F¤@¤U¡A¤jÅé¤W¤]³£¤£¿ù¡A¥u¬O®É¶¡Äæ¦ìªº»{©w¼Ò½k¦Ó¤w¡A
§Ú±Nק蠟³B¥Î ' ******** ¥[¥H¼Ð¥Ü¥X¨Ó¡A¤è«K§AÁA¸ÑµLªk°õ¦æªºì¦]¡A¤U¦^§A´N·|¹ê»ÚÀ³¥Î¤F¡C
ªþ¤W¤w°õ¦æªº½d¨Ò¡A¥H¤Î§Aªº×§ï«á¤§µ{¦¡½X (¦]§A©|µLªk¤U¸ü¡A©Ò¥H±N¥¦¶K¥Ü¥X¨Ó)¡A§A±Nµ{¦¡½X½Æ»s¨ì ThisWorkbook ¤º¡A¦Ó±N¼Ò²Õ²¾°£±¼¡C
- ' ½L¤¤ DDE ¦sÀɪº¹ê»ÚÀ³¥Î½d¨Ò
- Option Explicit
- Dim actEnabled As Boolean
- Dim CIndex As Single
-
- Private Sub Workbook_Open()
- If (Sheets("¤u§@ªí1").Range("A1").Value = "") Then Sheets("¤u§@ªí1").Range("A1").Value = "01:11:00" ' °²³]A1Äæ¦ì¬°ªÅ¥Õ¡A«h¼g¤J¶}½L°_©l®É¶¡
- If (Sheets("¤u§@ªí1").Range("A2").Value = "") Then Sheets("¤u§@ªí1").Range("A2").Value = "13:45:59" ' A2Äæ¦ì¥ç¦P¡C(¦¹¨âÄæ¬ö¿ý°_©l²×¤î®É¶¡)
- If (Sheets("¤u§@ªí1").Range("A3").Value = "") Then Sheets("¤u§@ªí1").Range("A3").Value = 0 ' ¬ö¿ý³Ì«á¸ê®Æ¶×¤J¤§¦C¸¹ (Rows)¡C
- If (Sheets("¤u§@ªí1").Range("A4").Value = "") Then Sheets("¤u§@ªí1").Range("A4").Value = "00:00:10" ' ¬ö¿ý¸ê®Æ¶×¤J¬Û¹j®É¶¡¡A¦p¨C¹j¤Q¬í¼g¤J¤@¦¸¡C
-
- ' If (TimeValue(Now) > Sheets("¤u§@ªí1").Range("A2").Value) Then ' ******** §A¥´ºâ¦ó®É¶}©l¹B§@¡H13:45:59 ¥H«á¡H
- If (TimeValue(Now) > Sheets("¤u§@ªí1").Range("A1").Value) Then ' ¦pªG¥Ø«e®É¶¡·~¤w¶W¹LA2ªº®É¬q¡A«h©I¥s.......
- ' Call stopProcedure ' ***** ®É¶¡¨ì¤F¡AÃø¹D§A¤£n°õ¦æ¡H
- Call startProcedure
- Else ' ¤Ï¤§¡A«h©I¥s.......
- Call stopProcedure
- ' Call startProcedure ' ***** ½Ð°Ý§A¬On¥¦¦b 14:00 ~ 01:09 ¶¡°õ¦æ¡H
- End If
- End Sub
-
- Private Sub Workbook_BeforeClose(Cancel As Boolean)
- On Error Resume Next
- Call actStop
- End Sub
-
- Sub startProcedure() ' «O¯d§@¬°±±¨î¶µ¤§À³¥Îµ{§Ç¡A¦p«ö¶s¤§¥¨¶°À³¥Îµ¥¡C
- Call actStart
- End Sub
-
- Sub stopProcedure() ' «O¯d§@¬°±±¨î¶µ¤§À³¥Îµ{§Ç¡A¦p«ö¶s¤§¥¨¶°À³¥Îµ¥¡C
- Call actStop
- End Sub
-
- Sub newTitle()
- ' ®M¤W§A±ý¶×¤J¸ê®ÆªºªíÀY¦WºÙ
- End Sub
-
- Sub Starter()
- If (actEnabled = True And TimeValue(Now) >= Sheets("¤u§@ªí1").Range("A1").Value And TimeValue(Now) <= Sheets("¤u§@ªí1").Range("A2").Value) Then
- CIndex = Sheets("¤u§@ªí1").Range("A3").Value
-
- If (CIndex = 0) Then Call newTitle '°²³]newTitleµ{§Ç(¥Ñ¨Ï¥ÎªÌ¦Û¦æ©w¸q)¬O±N²Ä¤@¦Cªº¸ê®Æ©ïÀY¦WºÙ¼g¤J¨ì¤u§@ªí2¡C ¦p¡G¤é´Á¡B®É¶¡¡BR1C5ªº¹ïÀ³Äæ¦ì¸ê®Æµ¥¡C
-
- Sheets("¤u§@ªí1").Range("A3").Value = CIndex + 1 ' ¬ö¿ý¦C¸¹¥[¤@¡C
- Sheets("¤u§@ªí2").Cells(CIndex + 2, 1).Value = Date
- Sheets("¤u§@ªí2").Cells(CIndex + 2, 2).Value = TimeValue(Now)
- ' Sheets("¤u§@ªí2").Cells(CIndex + 2, 3).Value = Sheets("¤u§@ªí1").Cells(1, 5).Value
- Sheets("¤u§@ªí2").Cells(CIndex + 2, 3).Value = Sheets("¤u§@ªí1").Cells(6, 1).Value ' ´ú¸Õ¡A ¦]¤µ¤Ñ¤£½æ³½¡A §Aªº«ü©wÄæ¦ì¦³ÂI..........
-
- '
-
- ' ½Æ»s±q¨é°ÓDDE¶×¤J¤§¬Û¹ïÀ³¦ì¸m¸ê®Æ¡A¦p R1C5 ¹ïÀ³ªº¥i¯à¬O¦¬½L»ùµ¥µ¥¡C
-
- '
- CIndex = Sheets("¤u§@ªí1").Range("A3").Value ' ********* ¼W¥[³¡¤À (Counter n¥[¤@¡A§_«h¥Ã»·¬°¹s)
- End If
- End Sub
-
- Sub onStarter()
- Call Starter
- If actEnabled Then Call actStart
- End Sub
-
- Sub actStart()
- actEnabled = True
- ' Application.OnTime (Now + Sheets("¤u§@ªí2").Range("A4").Value), "ThisWorkBook.onStarter" ' ***** ¤u§@ªí 2 ªº A4 þ¨ÓӮɶ¡³]©w¡H
- Application.OnTime (Now + Sheets("¤u§@ªí1").Range("A4").Value), "ThisWorkBook.onStarter" ' ¼g¤J¸ê®Æªº±Æµ{ (¥Ø«e¬O¨C¹j¤Q¬í¼g¤J¤@¦¸)
- End Sub
-
- Sub actStop()
- actEnabled = False
-
- On Error Resume Next
- Application.OnTime Now, "ThisWorkBook.onStarter", , False
- End Sub
½Æ»s¥N½X
DDE-4-14 ½L¤¤ DDE ¦sÀÉ»P VBA ªº¹ê»ÚÀ³¥Î½d¨Ò.rar (14.01 KB)
|
|