回復 1#tony.fang6413
附檔程式碼 Set TimeRange = .[A:A].Find(TimeSerial(Hour(Time), Minute(Time), 0), LookIn:=xlFormulas)
在 A欄尋找時間是錯誤的 時間在B欄
修改你的程式碼如下
Private Sub Workbook_Open()
If Time < Sheet2.[B3] Then
Application.OnTime Sheet2.[B3].Value, "ThisWorkbook.Achange"
Else
Achange
End If
End Sub
Private Sub Achange()
Dim TimeRange As Range
Set TimeRange = Sheet2.[B:B].Find(TimeSerial(Hour(Time), Minute(Time), 0), LookIn:=xlFormulas)
If Not TimeRange Is Nothing Then
TimeRange.Offset(, 1).Resize(1, 2) = Array(Sheet1.[F1], Sheet1.[F2])
Application.OnTime TimeSerial(Hour(Time), Minute(Time) + 1, 0), "ThisWorkbook.Achange"
End If
End Sub作者: tony.fang6413 時間: 2010-10-5 01:49