PC Review


Reply
Thread Tools Rate Thread

Delay copy & paste of data until web query refreshes?

 
 
CM4@FL
Guest
Posts: n/a
 
      16th Apr 2009
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

 
Reply With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      16th Apr 2009
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

--
If this post helps click Yes
---------------
Jacob Skaria


"CM4@FL" wrote:

> 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
>

 
Reply With Quote
 
Jacob Skaria
Guest
Posts: n/a
 
      16th Apr 2009
You can also put a loop until it finds data in Range("E10:N10")..

If this post helps click Yes
---------------
Jacob Skaria


"CM4@FL" wrote:

> 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
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do deselect data on paste and enable copy/paste again? das Microsoft Word New Users 1 30th Jun 2008 10:00 AM
Copy query, paste into Excel as data with VBA.. =?Utf-8?B?RGF2ZSBSYW1hZ2U=?= Microsoft Access VBA Modules 2 1st Aug 2007 11:52 PM
Excel cut/Paste Problem: Year changes after data is copy and paste =?Utf-8?B?QXNpZg==?= Microsoft Excel Misc 3 9th Dec 2005 05:16 PM
Simple question: How to get web query to NOT overwrite data when it refreshes? A Smith Microsoft Excel Misc 3 6th Sep 2004 06:55 AM
Simple question: How to get web query to NOT overwrite data when it refreshes? A Smith Microsoft Excel Programming 2 6th Sep 2004 04:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:14 PM.