Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy paste error | Charts and Charting in Excel | |||
copy and paste error | Excel Discussion (Misc queries) | |||
copy-paste error | Excel Programming | |||
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) | Excel Programming | |||
Error in Copy/Paste | Excel Programming |