Trying to get my code to loop for one minute.
Have tried this code (after searching through a few threads):
Sub LoopUsingTime() x = 1 EndTime = Now + TimeValue("00:01:00") For lCount = Now() To EndTime Sheet1.Cells(x, 1) = "the time is now " & Now() Sleep 5000 x = x + 1 Next lCount MsgBox ("loop finished") End Sub
It will loop once only before finishing. Does anyone have any ideas?
Does a loop have to use integers only?