Agree with Minty for this particular scenario. However in case its useful for the future, add this code to a standard module:
Code:
'Add PtrSafe - required for 64-bit Office (VBA7)
#If VBA7 Then
Private Declare PtrSafe Function SetCurrentDirectory Lib "kernel32" Alias "SetCurrentDirectoryA" (ByVal lpPathName As String) As Long
Declare PtrSafe Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
#Else '32-bit Office
Private Declare Function SetCurrentDirectory Lib "kernel32" Alias "SetCurrentDirectoryA" (ByVal lpPathName As String) As Long
Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
#End If
'###############################################
Sub Wait(N As Integer) 'creates a delay while other programs execute
For zCount = 1 To N
Sleep 1000 'sleep function from api library file
Next zCount
DoEvents 'allow screen to refresh
End Sub
Then just use e.g. Sleep 5 for a 5 second delay in all code processing
If you just want time for the CPU to complete earlier code before proceeding, just use DoEvents