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

Application.OnTime ¬O§_¦b°õ¦æ¤¤ªº»yªk?

Application.OnTime ¬O§_¦b°õ¦æ¤¤ªº»yªk?

¶}©l==> Application.OnTime The_Time, "timestock"
°±¤î==> Application.OnTime The_Time, "timestock", Schedule:=False

½Ð±Ð timestock ¬O§_¦b°õ¦æ¤¤ªº»yªk ???
if ........then

¦^´_ 1# t8899
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Dim The_Time As Date, Msg As Boolean
  3. Sub EX()
  4.     MsgBox "timestock  " & IIf(Msg, "°õ¦æ¤¤", "¤w°±¤î")
  5. End Sub
  6. Sub Ex_¶}©l()
  7.     Msg = True
  8.     The_Time = Time + #12:01:00 AM#
  9.     Application.OnTime The_Time, "timestock"
  10. End Sub
  11. Sub Ex_°±¤î()
  12.     Msg = False
  13.     Application.OnTime The_Time, "timestock", False
  14. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ t8899 ©ó 2014-8-5 20:40 ½s¿è
¦^´_  t8899
¸Õ¸Õ¬Ý
GBKEE µoªí©ó 2014-8-5 15:47

ÁÂÁÂ
§Úªº°ÝÃD¬O
  Application.OnTime The_Time, "timestock", Schedule:=False
¦³®É³o¦æ°±¤îµL®Ä,¤]¨S¦³¥X²{°T®§,....µM«á¦A­«¶]¡AÅܦ¨¨â­Ótimestock¦P®É¦b¶]
¤£ª¾¦p¦ó¸Ñ¨M?¦³µL¯S®í³B²z¤èªkÅý¥¦°±¤î?§Ú³£ÃöÀɦA­«¶}!
¦pªG¦b "timestock" °õ¦æ¤§«e°µ¤@­Ó¶}Ãö Msg As Boolean
timestock ªº¯u¥¿°õ¦æª¬ºAÀ³¤£¨ümsg ªº¼vÅT ??(¤£·|¶Çµ¹msg)
©Ò¥H§Ú­nªºÀ³¬O
if timestock ¥¿¦b°õ¦æ¤¤ «h¸õ¥X§_«h °õ¦æ

TOP

¦^´_ 3# t8899
VBA¨S¦³¨ç¼Æ¥i¶Ç¦^µ{¦¡¤¤¦³´X­ÓApplication.OnTime¦b°õ¦æ¤¤.
   
§Úªº°ÝÃD¬O
  Application.OnTime The_Time, "timestock", Schedule:=False
¦³®É³o¦æ°±¤îµL®Ä,¤]¨S¦³¥X²{°T®§,....µM«á¦A­«¶]¡AÅܦ¨¨â­Ótimestock¦P®É¦b¶]

Application.OnTime The_Time, "timestock"
¦³®É³o¦æ°±¤îµL®Ä Application.OnTime The_Time, "timestock", Schedule:=False
·|¬O¦]¬°§AThe_TimeÅܼƵ¹ªº®É¶¡¤£¤@¼Ë©Ò­P.
½Ð¸Õ±N timestockÅܼƦb¤@¯ë¼Ò²Õ³»ºÝ,³]¬°¤½¥ÎªºÅܼÆ,
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ t8899 ©ó 2014-8-6 06:37 ½s¿è
¦^´_  t8899
VBA¨S¦³¨ç¼Æ¥i¶Ç¦^µ{¦¡¤¤¦³´X­ÓApplication.OnTime¦b°õ¦æ¤¤.
½Ð¸Õ±N timestockÅܼƦb¤@¯ë¼Ò²Õ³»ºÝ,³]¬°¤½¥ÎªºÅܼÆ
GBKEE µoªí©ó 2014-8-6 06:04

ÁÂÁÂ !
§Ú³]ªºÅܼƬ°  The_Time = Time + my
¤½¥ÎÅܼƬO­n³]©wThe_Time ÁÙ¬O my ?ÁÙ¬O¥þ³]?
Public The_Time  As Date
Public my As Date

TOP

¥»©«³Ì«á¥Ñ t8899 ©ó 2014-8-6 06:45 ½s¿è

©êºp¡A§Úµo²{§Ú¦³³]¬°public¬°
Public The_Time As Date
Dim my As Date
my ¤]­n³]¬°  public ??¬O³o°ÝÃD¶Ü³y¦¨ªº¶Ü?

TOP

        ÀR«ä¦Û¦b : ¡i¬°µ½Ävª§¡j¤H¥Í­n¬°µ½Ävª§¡A¤À¬í¥²ª§¡C
ªð¦^¦Cªí ¤W¤@¥DÃD