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

[µo°Ý] ¦p¦óÅý­p®É¾¹°¨¤W¤¤Â_¸õ¥X??

[µo°Ý] ¦p¦óÅý­p®É¾¹°¨¤W¤¤Â_¸õ¥X??

¥»©«³Ì«á¥Ñ t8899 ©ó 2014-1-18 13:36 ½s¿è

¦b°õ¦æ°¨¤W¤¤Â_¸õ¥X (exit sub)
Application.OnTime Now + TimeValue("00:02:00"), "BBB"
Application.OnTime Time + #12:02:00 AM#, "bbb"

­p®É¾¹.rar (9.76 KB)
ªì·sªÌ~«ü±ÐÅo~

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-1-19 16:13 ½s¿è

¦^´_ 2# wl02353427
  1. Option Explicit
  2. Dim Msg As Boolean
  3. Sub startTimer()
  4.     Msg = False
  5.     Application.OnTime Now + TimeValue("00:00:01"), "Increment_count"
  6. End Sub

  7. Sub Increment_count()
  8.     If Msg Then Exit Sub
  9.     hiji = Now()
  10.     Range("A1") = hiji
  11.     'Range("A3").Value = Range("A3")+1 '­p¼Æ¾¹
  12.     startTimer
  13. End Sub
  14. Sub stopTimer()
  15.     Msg = True
  16.     'Application.OnTime Now + TimeValue("00:00:01"), "Increment_count", schedule:=False
  17.     '³s«ö¤G¦¸OnTime·|¦³¿ù»~
  18. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# wl02353427
ONTIME ¤èªk¥¢±Ñ?? 6666.rar (14.19 KB)
Application.OnTime Time + #12:00:10 AM#, "timestock", schedule:=False

TOP

¦^´_ 3# GBKEE

·PÁÂGBKEE«e½úªº§ó¥¿¡A«e½úªº¤èªkÁÙ¯uªº¬O²¼ä¦³¤O¡A¤p§ÌÁÙ¯u¬O¨S«ö¹L¨â¦¸....¯u¬O¤£²M·¡¡A¤]¨S¦³·Q¨ìifªº³o­Ó¥Îªk¡A¯u¬O¨ü¯q¨}¦h¡C
ªì·sªÌ~«ü±ÐÅo~

TOP

¦^´_  wl02353427
GBKEE µoªí©ó 2014-1-18 20:35


Dim my As Date
    If Sheet6.Range("V14").Value = 1 Then my = #12:01:00 AM#
    If Sheet6.Range("V14").Value = 2 Then my = #12:02:00 AM#
   

Application.OnTime Time + my, "timestock"


²×¤î¬°¦ó¿ù»~??(«¬ºA¤£²Å¦X)
Application.OnTime EarliestTime:=TimeValue(my), _
Procedure:="timestock", Schedule:=False

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-1-19 15:36 ½s¿è

¦^´_ 6# t8899
OnTime ¤èªk VBAªº»¡©ú½d¨Ò
  1. ¥»½d¨Ò³]©w 15 ¬í«á°õ¦æ my_Procedure µ{§Ç¡A±q²{¦b¶}©l­p®É¡C
  2. Application.OnTime Now + TimeValue("00:00:15"), "my_Procedure"               
  3. ¥»½d¨Ò³]©w my_Procedure ¦b¤U¤È 5 ÂI¶}©l°õ¦æ¡C
  4. Application.OnTime TimeValue("17:00:00"), "my_Procedure"               
  5. ¥»½d¨Ò¨ú®ø«e¤@­Ó½d¨Ò¹ï OnTime ªº³]©w¡C
  6. Application.OnTime EarliestTime:=TimeValue("17:00:00"), _
  7.     Procedure:="my_Procedure", Schedule:=False
½Æ»s¥N½X
Module2
  1. Option Explicit
  2. Public The_Time As Date
  3. Public Ie As Object
  4. Sub W1232222()
  5.     Set Ie = CreateObject("InternetExplorer.Application")
  6.     Ie.Navigate "http://newmis.twse.com.tw/stock/group.jsp?ex=tse&ind=TIDX#STATISTICS"
  7.     Do While Ie.Busy Or Ie.ReadyState <> 4: DoEvents: Loop
  8.     timestock
  9. End Sub
  10. Sub timestock()
  11.     Dim i As Integer, S As Integer, K As Integer, j As Integer, Element
  12.     If Sheets("sheet2").Range("A1") = 1 Then
  13.         Ie.Quit
  14.         Set Ie = Nothing
  15.         Sheets("sheet2").Range("A1") = 2
  16.         MsgBox "¸õÂ÷IEOK"
  17.         Exit Sub
  18.     End If
  19.     The_Time = Time + #12:00:10 AM#             'OnTimeªº®É¶¡
  20.     Application.OnTime The_Time, "timestock"
  21.     Application.ScreenUpdating = False
  22.     Do While Ie.Busy Or Ie.ReadyState <> 4: DoEvents: Loop
  23.     Set Element = Ie.document.getelementsbytagname("table")
  24.     With Sheets("sheet2")
  25.         .Range("C1:C4").ClearContents
  26.         For S = 2 To 2                    '¤w§ä¥Xºô­¶ªºtable¤º®e¦b 0-3 ¤¤
  27.             For i = 0 To Element(S).Rows.Length - 1
  28.                 K = K + 1
  29.                 j = 2
  30.                 .Cells(K, j + 1) = Element(S).Rows(i).Cells(j).innerText
  31.             Next
  32.         Next
  33.     End With
  34. End Sub
½Æ»s¥N½X
Sheet2
  1. Private Sub CommandButton1_Click()
  2.     If Not Ie Is Nothing Then
  3.         Application.OnTime The_Time, "timestock", schedule:=False
  4.         Ie.Quit
  5.         Set Ie = Nothing
  6.     End If
  7. End Sub
  8. Private Sub CommandButton2_Click()
  9.     W1232222
  10. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_  t8899
OnTime ¤èªk VBAªº»¡©ú½d¨ÒModule2Sheet2
GBKEE µoªí©ó 2014-1-19 15:20

¬ã¨s¤w¶W¹L2¤p®É¡AÁ٧줣¥X¿ù»~!
½Ð«ü¾É¡AÁÂÁÂ! 9999.rar (12.22 KB)

TOP

¦^´_ 8# t8899
  1. Option Explicit  '±j­¢µ{¦¡«Å§i¨Ï¥ÎªºÅܼÆ,¥i¥H§ä¥X¨S¦³«Å§iªºÅܼÆ,©ö©óµ{¦¡½Xªº°»¿ù
  2. Dim tome As Date '¦b¼Ò²ÕºÝDim ¬O³o¼Ò²Õªº¨p¦³ÅܼÆ,³o¼Ò²Õªºµ{¦¡³£¥i¥H¤Þ¥Î¨ìªº
  3. Sub timestock()
  4.     'Dim tome As Date      '¦bµ{¦¡¤ºªº Dim ¬O³oµ{¦¡ªº¨p¦³ÅܼÆ,³oµ{¦¡©Ò¦³DimªºÅܼƤº®e,¦bµ{¦¡°õ¦æ§¹²¦«á,·|³QÄÀ©ñ±¼,¨ä¥Lµ{¦¡¤Þ¥Î¤£¨ìªº
  5.     tome = TimeValue(Now) + TimeValue("00:00:05")
  6.     Application.OnTime tome, "sheet2.timestock"
  7.     MsgBoxTest 0, "test ", "´£¥Ü°T®§", vbInformation, 0, 1500
  8. End Sub
  9. Private Sub CommandButton1_Click()
  10.     If tome > 0 Then
  11.         Application.OnTime EarliestTime:=TimeValue(tome), _
  12.             Procedure:="sheet2.timestock", Schedule:=False
  13.             tome = 0
  14.     End If
  15. End Sub
  16. Private Sub CommandButton2_Click()
  17.     timestock
  18. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ t8899 ©ó 2014-1-19 18:18 ½s¿è

§ÚÀ´¤F¡Aµ{¦¡°õ¦æ§¹ÅܼƴN³QÄÀ©ñ±¼¡A¤×©ó­n¦Aµ¥5¬í¤~·|¦A°õ¦æ, ³o¤¤¶¡ °õ¦æ Schedule:=False §ä¤£¨ìÅܼÆ....
Ãþ¦ü³oºØµ¥«Ý®É¶¡¦A­«Âаõ¦æªºµ{§Ç¡A³Ì¦n¥Î public «Å§iÅýÅܼƤ£­n³QÄÀ©ñ

TOP

        ÀR«ä¦Û¦b : ¤H¥Í¨S¦³©Ò¦³Åv¡A¥u¦³¥Í©Rªº¨Ï¥ÎÅv¡C
ªð¦^¦Cªí ¤W¤@¥DÃD