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

[µo°Ý] Application.OnTime µLªk²×¤î ?

¦^´_ 10# t8899

textª©¤w±H¨ì«H½c

TOP

¦^´_ 8# t8899
¦³¥H¤U¤§¼Ò¦¡¥i¨Ñ§A¿ï¥Î¡G
(¤@)
  1. ¸m©ó¼Ò²Õ Module1 ¤º¡G
  2. Private Sub Auto_Open()
  3.     Ex
  4. End Sub

  5. Sub Ex()
  6.     Static cts
  7.    
  8.     cts = cts + 1
  9.     Cells(cts, 1).Value = "Here I Am!"
  10.    
  11.     Application.OnTime (Now + TimeValue("00:03:00")), "Module1.Ex"
  12. End Sub
½Æ»s¥N½X
(¤G)
  1. ¸m©ó ThisWorkbook ¤º¡G
  2. Private Sub Workbook_Open()
  3.     Ex
  4. End Sub

  5. Sub Ex()
  6.     Static cts
  7.    
  8.     cts = cts + 1
  9.     Cells(cts, 1).Value = "Here I Am!"
  10.    
  11.     Application.OnTime (Now + TimeValue("00:03:00")), "ThisWorkbook.Ex"
  12. End Sub
½Æ»s¥N½X
(¤T)
  1. ¸m©ó¼Ò²Õ Module1 ¤º¡G
  2. Private Sub Auto_Open()
  3.     ¤u§@ªí1.Ex
  4. End Sub

  5. ¸m©ó ¤u§@ªí1 ¤º¡G
  6. Sub Ex()
  7.     Static cts
  8.    
  9.     cts = cts + 1
  10.     Cells(cts, 1).Value = "Here I Am!"
  11.    
  12.     Application.OnTime (Now + TimeValue("00:03:00")), "¤u§@ªí1.Ex"
  13. End Sub
½Æ»s¥N½X

TOP

stop.rar (8.16 KB)
Sub Macro1()
'
' Macro1 Macro
'
' §Ö³tÁä: Ctrl+p
'
[a1] = [a1] + 1
Application.OnTime Now + TimeValue("00:00:05"), "Sheet1.a123"
End Sub


§r¡T½Ð°Ý­n«ç¼Ë°±¤î¡H
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

­ì¨Ó¬O³o¼Ë¤l
http://office.microsoft.com/zh-tw/excel-help/HP005203075.aspx

°±¤î¥¨¶°
¥þ³¡Åã¥Ü¥þ³¡Åã¥Ü

½Ð°õ¦æ¤U¦C¨ä¤¤¤@¶µ°Ê§@¡G

    ¦pªG±z­n°±¤î¤@­Ó¥Ø«e¨Ï¥Î¤¤ªº¥¨¶°¡A½Ð«ö ESC¡AµM«á«ö¤@¤U [Microsoft Visual Basic] ¹ï¸Ü¤è¶ô¤Wªº [µ²§ô]¡C
    ¦pªG±z·Q­nÁקK¦b±Ò°Ê Microsoft Excel ®É¦Û°Ê°õ¦æ¥¨¶°¡A½Ð¦b±Ò°Ê®É«ö¦í SHIFT¡C
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

²Ä1+a ªºrow ©ñ¤J®É¶¡
Timothy

TOP

没¦³权­­¤U载ªþ¥ó¡A¥D­n¬O¦Û¤v¤ô¥­¤Óµæ°Ú
¦V°ª¤â学习

TOP

ÁÙ¬O°Ê¤£¤F
Cells(1 + a, 1) = Time ===>¬O¤°·N«ä
t8899 µoªí©ó 2013/1/22 23:56

¬d¬ÝVBAªº»¡©ú¥i¤F¸Ñ

TOP

[µo°Ý] Application.OnTime µLªk²×¤î ?

Sub amou()
Range("a1") = Range("a1") + 1
runtime2 = Now + TimeValue("00:00:10")
Application.OnTime runtime2, "amou"
End Sub

Sub a123()
On Error Resume Next
'Application.OnTime EarliestTime:=TimeValue(Runtime2), _
'   Procedure:="amou", Schedule:=False
' Application.OnTime EarliestTime:=Runtime2, _
  '   Procedure:="amou", Schedule:=False
  Application.OnTime runtime2, "amou", Schedule:=False
On Error GoTo 0
End Sub

¥»©«³Ì«á¥Ñ GBKEE ©ó 2015-3-29 10:04 ½s¿è

¦^´_ 1# t8899
¦b³o  Sub amou() ªº¼Ò²Õ³»ºÝ«Å§i runtime2 ¬°¤½¥ÎÅܼÆ
¦p¦¹ Sub a123() ¤~¥i±o¨ìruntime2 ÅܼÆ
  1. Public runtime2 As Date
  2. Sub amou()
  3. 'Dim runtime2 As Date ¤£­n¦A«Å§i runtime2 ÅܼÆ
  4. Range("a1") = Range("a1") + 1
  5. runtime2 = Now + TimeValue("00:00:10")
  6. Application.OnTime runtime2, "amou"
  7. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_  t8899
¦b³o  Sub amou() ªº¼Ò²Õ³»ºÝ«Å§i runtime2 ¬°¤½¥ÎÅܼÆ
¦p¦¹ Sub a123() ¤~¥i±o¨ìruntime2  ...
GBKEE µoªí©ó 2015-3-29 10:01

ÁÂÁÂ!´X¬í°õ¦æ¤@¦¸¦³µL¨ä¥L¤èªk??
¤×¨ä¹³1¬í1¦¸(®ÉÄÁ)¡A·Æ¹««ü¼Ð·|Åܦ¨º|¤æ¤@°{¤@°{ªºª¬ºA...

TOP

        ÀR«ä¦Û¦b : §ïÅܦۤv¬O¦Û±Ï¡A¼vÅT§O¤H¬O±Ï¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD