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

Ãö©óOnTimeµo¥Íªº¿ù»~¡A¨D¸Ñ¡I~~·P®¦

Ãö©óOnTimeµo¥Íªº¿ù»~¡A¨D¸Ñ¡I~~·P®¦

¤p§Ì¥Î¤FworkbookªºOpen¨Æ¥ó¨Ó±Ò°Ê¤@­Ó¥Î¤FOnTime¥\¯à¡A¨Ó§Û¿ý½L¤¤ªÑ»ùªº§Y®ÉÅܤơA¦ý¶]¨ì¹w³]µ²§ô®É¶¡¡A¥X¤F¤@­Ó¿ù»~°T®§¡A½Ð¦U¦ì«e½úÀ°¦£§i¶D§Ú°ÝÃD¥X¦b­þ¸Ì¡H
½s½X¦p¤U
Private Sub Workbook_Open()
    Application.OnTime TimeValue("21:34:00"), "»ù®t¬ö¿ý"
End Sub
--------------------------------------------------------------------------
Sub »ù®t¬ö¿ý()
    Dim Line As Double
    Dim Close_T As String
    Line = Sheet1.Range("F1").End(xlDown).Row
    Close_T = Format(Time, "h:m")
    If Close_T <> "21:35" Then
        Sheet1.Cells(Line + 1, 6) = Cells(2, 6)
        Sheet1.Cells(Line + 1, 7) = Cells(2, 7)
        Application.OnTime Now + TimeValue("00:00:05"), "»ù®t¬ö¿ý"
    Else
         Application.OnTime Now + TimeValue("00:00:05"), "»ù®t¬ö¿ý", , False
    End If
End Sub
¿ù»~°T®§¦p¤U¡G

¦^´_ 5# oklin
¬Oªº¡A¨S¿ù
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

¦^´_ 2# stillfish00
©Ò¥H±zªº·N«ä¬O¡A¦]¬°§Úªº»Ý¨D¬O¨ì¤F¬Y¤@®É¶¡´N°±¤î¨C5¬í§ì¤@¦¸¸ê®Æ¡A©Ò¥H¡A§Ú¥u¶·§PÂ_®É¶¡¨ì¤F¨S¡A¦pªGÁÙ¨S¦³¨ì¡A´N¹w¬ù¤U¤@­Ó5¬í¡A¤@¥¹®É¶¡¨ì¤F´N¤£¥Î¹w¬ù¡AOnTime´N°±¤F¡C¹ï¶Ü¡H
©Ò¥H§Ú¥u¶·§â
Else
         Application.OnTime Now + TimeValue("00:00:05"), "»ù®t¬ö¿ý", , False
¬å±¼´N¥i¹F¦¨§Úªº´Á±æ¤F¡I

TOP

¦^´_ 1# oklin
°²³]²{¦b®É¶¡ 21:34:55
°õ¦æ¤@¦¸'»ù®t¬ö¿ý':
    Close_T <> "21:35" ©Ò¥H°õ¦æ Then °Ï¶ôµ{¦¡½X
    Application.OnTime Now + TimeValue("00:00:05"), "»ù®t¬ö¿ý"
    ¹w¬ù¤F¤U¦¸°õ¦æ®É¶¡ ¤j¬ù¦b 21:35:00  , µ²§ô
   
®É¶¡ 21:35:00
°õ¦æ'»ù®t¬ö¿ý':
    Close_T = "21:35" ©Ò¥H°õ¦æ Else °Ï¶ôµ{¦¡½X
    Application.OnTime Now + TimeValue("00:00:05"), "»ù®t¬ö¿ý", , False
    ¨ú®ø«o¬O¨ú®ø¤w¹w¬ù¦b 21:35:05 ªº'»ù®t¬ö¿ý'


*·|»¡¤j¬ù¬O¦]¬°¡A¦pªG§A«e­±°õ¦æªºµ{¦¡½X¤@¦h¡A
·í§A°õ¦æ¨ìNow®É¨ú±oªº®É¶¡¥i¯à¤w¤£¬O21:34:55

¤W¶Çªþ¥ó¦³­­¨î°ÆÀɦW¡A§A¥i¥HÀ£ÁY¦A¶Ç¡A¤U¹Ï¦³¼g
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

¦^´_ 2# stillfish00
·PÁ±zªº¦^ÂСA¦ý§Ú¤£¬O«Ü¤F¸Ñ±zªº·N«ä¡A¦r­±¤W§Úªº±Æµ{°£¤F¤@¶}©lªºWorkbook openIJµoªº¬O¤@­Ó©T©w®É¶¡¡A¤§«á´N¬O¨C¹j5¬í±Ò°Ê¤@¦¸¡A¤]´N¬O¤U­±³o¤@¦æ
Application.OnTime Now + TimeValue("00:00:05"), "»ù®t¬ö¿ý"
Esle¤§«á¨ú®øªº¤]¬O
Application.OnTime Now + TimeValue("00:00:05"), "»ù®t¬ö¿ý"¡A¡AFalse
¥t½Ð±Ð¤@¤U¡A§Ú¸Õ­n¤W¶ÇÀɮסA¼u¨t²Î§i¶D§Ú¤£¤ä´©¦¹ÃþÂX®i©úªºÀɮסA½Ð°Ý§Ú¸Ó¦p¦ó³B²z¡C

TOP

¦^´_ 1# oklin
§AªºElse¨º¬q§¹¥þ¨S¥Î~

Application.OnTime ¬O±Æµ{
¥ÎFalse°Ñ¼Æ¬O¨ú®ø¬Y®É¶¡ªº±Æµ{
¬JµM§A®É¶¡¨ì´N¤£¦A±Æµ{¤F¡A¨º»ò¸Ó®É¶¡´N¨SªF¦è¥i¥H¨ú®ø

¦Ó¥B­n¨ú®øªº¸Ü¡A®É¶¡­n¤@­P¡A§A³o¼Ë¬O¤£·|¤@­Pªº
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

        ÀR«ä¦Û¦b : ¹ï¤÷¥À­nª¾®¦¡A·P®¦¡B³ø®¦¡C
ªð¦^¦Cªí ¤W¤@¥DÃD