The below code gives a run-time error 1004 (undefined object) and it is isolating the DateDiff function as the problem. What gives?
The below code works fine:
Code:
Sub Speed_DoesNotWork
Dim start_time, end_time
start_time = Now()
end_time = Now()
Sheets("SpeedLog").Select
Range("C1").End(xlDown).Offset(1, 0).Value = DateDiff("s", start_time, end_time)
End Sub
The below code works fine:
Code:
Sub Speed_Works
Dim start_time, end_time
start_time = Now()
end_time = Now()
MsgBox "This CVTY Speed Search was completed in" & " " & (DateDiff("s", start_time, end_time)) & " " & "seconds."
End Sub