Option Explicit
Sub Ex()
Dim Rng As Range, Rng1 As Range, i%
If Time < TimeValue("09:00:00") Then
Application.OnTime TimeValue("09:00:03"), "SHEET1.EX"
Exit Sub
ElseIf Time >= TimeValue("13:30:00") Then Exit Sub
End If
Set Rng = Sheets("SHEET2").Range("B307:C307")
Set Rng1 = Cells(Rows.Count, "A").End(xlUp)(2)
Rng1 = Time
For i = 1 To Rng.Count
Rng1(1, i + 1) = Rng(i)
Next
Application.OnTime Now() + TimeValue("00:00:03"), "SHEET1.EX"
End Sub作者: wells330 時間: 2011-6-13 10:51