iStart = 0
iEnd = 9
errorTime = 10
Do
Wait .2
MsgBox iStart
iStart = iStart + 1
Loop Until iStart = iEnd Or iStart = errorTimer

If iStart = errorTimer Then
MsgBox “Time Out Error”
Exit Sub
End If