" xTime = TimeValue(E.Rows(R).Cells(0).innertext)
If IsError(Application.Match(xTime, .[A:A], 0)) Then "
用時間概念去做比對就沒有做出正確的結果
因此把xTime 改為 字串:
dim xTime$
xTime = "#" & E.Rows(R).Cells(0).innertext & "#"
If IsError(Application.Match(xTime, .[A:A], 0)) Then "
當然也把時間字串放到儲存格內:
RR = Application.CountA(.[A:A]) + 1
.Cells(RR, 1) = xTime
For C = 1 To E.Rows(R).Cells.Length - 1
.Cells(RR, C + 1) = E.Rows(R).Cells(C).innertext
Next
這樣,問題就解決了
另,Application.OnTime 修飾如下:
If Time <= #2:30:00 PM# Then Application.OnTime Now + #12:04:00 AM#, "Ex_yahoo" '4分鐘後再度執行