I am trying to insert a Wait function in my code but I am receiving a Run-time error '13': Type Mismatch message.
With Worksheets("Screen")
lr = .Cells(.Rows.Count, 1).End(xlUp).Row
For i = 2 To lr
Sheets("Screen").Select
Range("B" & i).Select
Selection.Copy
Sheets("Outputs").Select
Sheets("Outputs").Range("A2").Select
ActiveSheet.Paste
Application.Wait (Now() + "00:00:30")
Sheets("Outputs").Select
Sheets("Outputs").Range("B2:F2").Select
Selection.Copy
Sheets("Screen").Select
Range("C" & i).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next i
End With
MsgBox "Calculations complete"
Application.ScreenUpdating = True
End Sub
I am trying to insert the Wait function because when I paste the Range("B" & i) from the Screen worksheet to the Range("A2") on the Outputs worksheet I need the Range("B2:F2") on the Outputs worksheet to populate before it is copied to the Range("C" & i) on the Screen worksheet. The Range("B2:F2") on the Outputs worksheet takes a while to populate because it has to wait on some Web Queries in order to populate and the copy and pasting code is too quick so I do not end up with accurate data be copied into the Range("C" & i) on the Screen worksheet.
Any suggestions?!?
Thanks!
Bookmarks