大家好!
以下巨集如何增設Stop指令,感恩!
Option Explicit
Sub Ex()
Dim Rng As Range, Rng1 As Range, i%
If Time < TimeValue("09:00:00") Then
Application.OnTime TimeValue("09:01:13"), "SHEET2.EX"
Exit Sub
ElseIf Time >= TimeValue("13:35:30") Then Exit Sub
End If
Set Rng = Sheets("SHEET2").Range("B309:Z309")
Set Rng1 = Cells(Rows.Count, "A").End(xlUp)(2)
Rng1 = Time
Rng1(1, 2).Resize(1, Rng.Columns.Count) = Rng.Value
Application.OnTime TimeSerial(Hour(Now), Minute(Now) + 1, 13), "SHEET3.EX"
End Sub作者: oobird 時間: 2011-5-27 10:27
有許多方法建立停止機制
如在前面加1行
if [a1]=1 then end
當你在a1輸入1 時程式自然終止作者: wells330 時間: 2011-5-27 10:38