Simple. Don't use sleep. Either tell the code to stop executing and restart under certain circumstances, or:
Code:
While X <> 10
DoEvents
Loop
'Nothing happens till X = 10