Delay copy & paste of data until web query refreshes?

C

CM4@FL

I need to delay copying my data in cells E10:N:10 while my web query
completely refreshes, after the refresh is complete then can I copy the data.
Can anyone help me with the delay function?

Range("B4:C4").Select
Selection.Copy
Range("E4").Select
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveWorkbook.RefreshAll
********* NEED A DELAY FUNCTION HERE *********
Range("E10:N10").Select
Selection.Copy
Range("E47").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

Thanks in advance
 
J

Jacob Skaria

Paste the below procedure and call Wait (2) in your code to wait for 2
seconds...


Sub Wait(sngDelayInSecs As Single)
EndDelay = Timer + sngDelayInSecs
Do While Timer < EndDelay
DoEvents
Loop
End Sub
 
J

Jacob Skaria

You can also put a loop until it finds data in Range("E10:N10")..

If this post helps click Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top