LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default copy and paste error

I see... thanks to both of you.

"Dave Peterson" wrote:

Is this in a general module?

I'm guessing yes.

this line:
Sheets("dump").Cells("A2").PasteSpecial xlPasteValues
should be:
Sheets("dump").Range("A2").PasteSpecial xlPasteValues
(replace .cells() with .range().)

But when I ran your code, this line:
Selection.ClearContents

Cleared the clipboard for me. That meant that there was nothing to paste.

You could rearrange your code so that it clears the contents before it does the
copy.

If this code is behind a worksheet module, then more needs to be done.

John wrote:

Could someone help me with why I get an error when I run this simple code to
copy and paste... THANKS!

Sheets("DATA").Select
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets("dump").Select
Range("A2").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.ClearContents
Sheets("dump").Cells("A2").PasteSpecial xlPasteValues
Range("A2").Select
End Sub


--

Dave Peterson

 
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
Copy paste error ganeson r Charts and Charting in Excel 1 December 13th 09 08:25 AM
copy and paste error jenny Excel Discussion (Misc queries) 2 January 16th 09 01:53 PM
copy-paste error Bernie Deitrick Excel Programming 0 April 27th 04 05:12 PM
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) Tim[_36_] Excel Programming 4 April 23rd 04 02:53 AM
Error in Copy/Paste Thierry zen Ruffinen Excel Programming 0 April 5th 04 09:46 AM


All times are GMT +1. The time now is 04:03 PM.

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

About Us

"It's about Microsoft Excel"