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

[µo°Ý] ½Ð±Ð¦¹µ{§Ç¦p¦ó§ï?

[µo°Ý] ½Ð±Ð¦¹µ{§Ç¦p¦ó§ï?

¥»©«³Ì«á¥Ñ t8899 ©ó 2013-10-9 11:47 ½s¿è

Public Runtime
Sub a123()
If [U1] <> 1 Then
On Error Resume Next
Application.OnTime EarliestTime:=TimeValue(Runtime), _
    Procedure:="a123", Schedule:=False
  Exit Sub
On Error GoTo 0
End If
zzzzz
If Range("V14") = 1 Then mytime = "00:01:00"
If Range("V14") = 2 Then mytime = "00:02:00"
If Range("V14") = 3 Then mytime = "00:00:30"
If Range("V14") = 4 Then mytime = "00:00:15"
'--------------------------------------
Runtime = Now + TimeValue(mytime)
Range("I15").Value = Format(Runtime, "hh:mm:ss")

'------------------------------------------------------
Application.OnTime Runtime, "Sheet6.a123"
End Sub

---------------------------------------------------------------------

²Ä¤@¦¸°õ¦æ
Runtime = Now + TimeValue(mytime)
Range("I15").Value = Format(Runtime, "hh:mm:ss")
¤§«á¬Ò¬°
Runtime = Range("I15").Value + TimeValue(mytime)
Range("I15").Value = Format(Runtime, "hh:mm:ss")

¦^´_ 1# t8899
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Public Runtime
  3. Sub a123()
  4.     Static Msg As Boolean
  5.     Dim mytime As String
  6.     If [U1] <> 1 Then
  7.         On Error Resume Next
  8.         Application.OnTime EarliestTime:=TimeValue(Runtime), _
  9.             Procedure:="a123", Schedule:=False
  10.         Exit Sub
  11.         On Error GoTo 0
  12.     End If
  13.    zzzzz
  14.     If Range("V14") = 1 Then mytime = "00:01:00"
  15.     If Range("V14") = 2 Then mytime = "00:02:00"
  16.     If Range("V14") = 3 Then mytime = "00:00:30"
  17.     If Range("V14") = 4 Then mytime = "00:00:15"
  18.     '--------------------------------------
  19.     With Range("I15")
  20.         If Msg = False Then
  21.             Msg = True
  22.             Runtime = Time + TimeValue(mytime)
  23.             .Value = Runtime
  24.             .NumberFormatLocal = "h:mm:ss;@"
  25.         Else
  26.             Runtime = .Value + TimeValue(mytime)
  27.             .Value = Runtime
  28.         End If
  29.     End With
  30.     '------------------------------------------------------
  31.     Application.OnTime Runtime, "Sheet6.a123"
  32. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ t8899 ©ó 2013-10-13 10:08 ½s¿è
¦^´_  t8899
¸Õ¸Õ¬Ý
GBKEE µoªí©ó 2013-10-12 16:25


ÁÂÁ«ü¾É,vb ¥¿¾Ç²ß·í¤¤¡A¦h¤éµL¤H¦^À³¡A¤p§Ì·Q¥XªºÂ²³æªº¤èªk,´£¨Ñ°Ñ¦Ò
Public Runtime
Sub a123()
If Range("U1").Value <> 1 Then
On Error Resume Next
Application.OnTime EarliestTime:=TimeValue(Runtime), _
    Procedure:="a123", Schedule:=False
Cells(15, 9).Interior.ColorIndex = 2   '°h¥X¦â±mÁÙ­ì
Range("u1").Value = 1
Range("z1").Value = 1
  Exit Sub
On Error GoTo 0
End If
zzzzz
If Range("V14") = 1 Then mytime = "00:01:00"
If Range("V14") = 2 Then mytime = "00:02:00"
If Range("V14") = 3 Then mytime = "00:00:30"
If Range("V14") = 4 Then mytime = "00:00:15"

If Range("z1").Value = 1 Then
Cells(15, 9).Interior.ColorIndex = 8     '°õ¦æ¤¤Åܦâ
Runtime = Now + TimeValue(mytime)
Range("I15").Value = Format(Runtime, "hh:mm:ss")
Range("z1").Value = 2  
Else
Runtime = Range("I15").Value + TimeValue(mytime)
Range("I15").Value = Format(Runtime, "hh:mm:ss")
End If
Application.OnTime Runtime, "Sheet6.a123"
End Sub

TOP

¦^´_  t8899
¸Õ¸Õ¬Ý
GBKEE µoªí©ó 2013-10-12 16:25


On Error Resume Next  =========>³o¥yÀ³¥i®³±¼??
u1 ¤£µ¥©ó1 ®É¨Ã¤£µ¥©ó"¿ù»~"??

TOP

¥»©«³Ì«á¥Ñ luhpro ©ó 2013-10-14 23:14 ½s¿è
On Error Resume Next  =========>³o¥yÀ³¥i®³±¼??
u1 ¤£µ¥©ó1 ®É¨Ã¤£µ¥©ó"¿ù»~"??
t8899 µoªí©ó 2013-10-13 10:21

On Error ¹³­Ó¤Á´«¶}Ãö,
·N«ü¤§«á¹J¨ì¿ù»~®É¸Ó¦p¦ó³B²z.

On Error Resume Next  ¬O§i¶D¨t²Î : ¤§«á¹J¨ì¿ù»~®É½Ð©¿²¤¸Ó¿ù»~, ±qµo¥Í¿ù»~ªº¤U¤@¦æÄ~Äò°õ¦æ¤U¥h.
©Ò¥H¥¦ªº§@¥Î½d³ò¬Oª½¨ì¤U¤@¦¸°õ¦æ¨ì On Error ... «ü¥O¦ÓÅܧó¤F¿ù»~³B²z¤è¦¡ ©Î¬O ±NÀÉ®×Ãö³¬ ¬°¤î,
¬G¦Ó¨Ã¤£¾A¦X³æ¯Â¦]¬°  u1 ¤£µ¥©ó1 ®É¨Ã¤£µ¥©ó"¿ù»~"   ³o­Ó¦]¯À¦Ó®³±¼.


¥t§Aªºµ{¦¡¤¤ On Error GoTo 0 ¦]¬°¬O¦b Exit Sub ¤§«á, ©Ò¥H¥Ã»·¤£·|³Q°õ¦æ¨ì,
­Y§Æ±æ¥¦µo´§§@¥ÎÀ³§ï©ñ¨ì Exit Sub ¤§«e.

TOP

        ÀR«ä¦Û¦b : ¤H¥Í¤£¤@©w²y²y¬O¦n²y¡A¦ý¬O¦³¾ú½mªº±j¥´ªÌ¡AÀH®É³£¥i¥H´§´Î¡C
ªð¦^¦Cªí ¤W¤@¥DÃD