Here is Microsoft's example dor DoEvents:
' Create a variable to hold number of Visual Basic forms loaded
' and visible.
Dim I, OpenForms
For I = 1 To 150000 ' Start loop.
If I Mod 1000 = 0 Then ' If loop has repeated 1000 times.
OpenForms = DoEvents ' Yield to operating system.
End If
Next I ' Increment loop counter
--
raypayett
-----------------------------------------------------------------------
raypayette's Profile:
http://www.excelforum.com/member.php...fo&userid=2956
View this thread:
http://www.excelforum.com/showthread.php?threadid=57091