Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Copy/Paste Revisted

I have finally got the following code (copy/paste from one worksheet to
another in the same workbook) to run, by including a call statement in the
main code......

Call My_Copy
--------------------------------------------
Sub My_Copy()
For i = 2 To 17
Sheets("Latest Snapshot").Range("J3:J17").Copy
Sheets("Chartdata").Cells(2, i).PasteSpecial Paste:=xlPasteValues
Application.Wait (Now + TimeValue("0:00:50"))
Next i
End Sub
-----------------------------------------------------------
However, this runs all the time and copy/pastes every 50 seconds until
condition 15 is satified. It also uses a lot of resources, thus
interfering with the running of the main code.

Could I get the above to 'turn off' until the second request and so on is
required?

I'm thinking of a the following statements:-

Select Case
For...Next
For Each Loop
Do Until LoopWhile...Wend Loop
Early Exit Loop

Or maybe resorting to the following long hand code renaming each copy/paste
as a different sub routine and call upon each one in turn? Is this
possible and how could I achieve this? Sorry to sound dumb, but I'm only
beginner!

TIA
---------------------------------------------------------------------
Option Explicit
Dim i As Integer
Sub My_Copy()
Sheets("Latest Snapshot").Select
Range("J3:J17").Select
Selection.Copy
Sheets("Chartdata").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Sheets("Latest Snapshot").Select
Range("J3:J17").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Chartdata").Select
Range("C2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Sheets("Latest Snapshot").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Chartdata").Select
Range("D2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't Copy and Paste or Paste Special between Excel Workbooks wllee Excel Discussion (Misc queries) 5 April 29th 23 03:43 AM
Nested IF function Revisted Studebaker Excel Worksheet Functions 7 January 29th 07 03:47 PM
Nearly There! (Revisted) Saxman[_5_] Excel Programming 9 December 18th 05 05:44 PM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
Copy and Paste macro needs to paste to a changing cell reference loulou Excel Programming 0 February 24th 05 10:29 AM


All times are GMT +1. The time now is 04:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"