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

All, I have this code and I cannot find out why it will not paste. I am
getting the following error when trying to run this macro "Runtime Error
1004: Paste method of worksheet class failed." Here is the code that I am
trying to run:

Sheets("CNP").Select
Columns("A:Z").Select
Selection.Delete Shift:=xlToLeft
Range("A1").Select
ActiveSheet.Paste
Range("E:N,P:V,X:AC").Select
Selection.Delete Shift:=xlToLeft
Range("A1:F82").Select
Selection.Copy
Sheets("Daily").Select
Range("A2:F82").Select
Selection.ClearContents
Range("A2").Select
ActiveSheet.Paste
Range("A6:F83").Select
Application.CutCopyMode = False
Selection.Sort Key1:=Range("F5"), Order1:=xlDescending, Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Sheets("CNP").Select
Columns("B:E").Select
Selection.Delete Shift:=xlToLeft
Range("A:B").Select
Selection.Copy
Sheets("Data").Select
Dim rFound As Range
Set rFound = Sheet1.Cells.Find("*", _
Sheet1.Cells(1, 1), , , xlByColumns, xlPrevious)
If rFound Is Nothing Then
Range("A:B").Select
Else
rFound.Offset(0, 1).Resize(1, 2).EntireColumn.Select
End If
ActiveSheet.Paste
End Sub

It is failing on the second paste for some reason and I cannot figure out
why. Any help would be greatly appreciated.

Nathan Bell


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Paste Failed

Gotta copy something before you can paste. Also, remove selections.

Sheets("CNP").Select
Columns("A:Z").Select
Selection.Delete Shift:=xlToLeft
Range("A1").Select
ActiveSheet.Paste

============
Range("A1:F82").Copy Sheets("Daily").Range("A2")


--
Don Guillett
SalesAid Software

"Nathan Bell" wrote in message
...
All, I have this code and I cannot find out why it will not paste. I

am
getting the following error when trying to run this macro "Runtime Error
1004: Paste method of worksheet class failed." Here is the code that I am
trying to run:

Sheets("CNP").Select
Columns("A:Z").Select
Selection.Delete Shift:=xlToLeft
Range("A1").Select
ActiveSheet.Paste
Range("E:N,P:V,X:AC").Select
Selection.Delete Shift:=xlToLeft
Range("A1:F82").Select
Selection.Copy
Sheets("Daily").Select
Range("A2:F82").Select
Selection.ClearContents
Range("A2").Select
ActiveSheet.Paste
Range("A6:F83").Select
Application.CutCopyMode = False
Selection.Sort Key1:=Range("F5"), Order1:=xlDescending,

Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Sheets("CNP").Select
Columns("B:E").Select
Selection.Delete Shift:=xlToLeft
Range("A:B").Select
Selection.Copy
Sheets("Data").Select
Dim rFound As Range
Set rFound = Sheet1.Cells.Find("*", _
Sheet1.Cells(1, 1), , , xlByColumns, xlPrevious)
If rFound Is Nothing Then
Range("A:B").Select
Else
rFound.Offset(0, 1).Resize(1, 2).EntireColumn.Select
End If
ActiveSheet.Paste
End Sub

It is failing on the second paste for some reason and I cannot figure out
why. Any help would be greatly appreciated.

Nathan Bell




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
Method 'Paste' of object '_Worksheet' failed markline Excel Discussion (Misc queries) 7 May 28th 05 05:02 AM
Method 'Paste' of object '_worksheet' failed Greg Bloom Excel Programming 4 October 18th 04 06:19 PM
VB Error: Paste Special method of range class failed Chris Excel Programming 2 January 30th 04 12:51 PM
Cut Paste Undo Failed Von Shean Excel Programming 1 January 10th 04 08:14 PM
Paste method of worksheet class failed error Todd Huttenstine[_2_] Excel Programming 1 December 16th 03 10:08 AM


All times are GMT +1. The time now is 08:59 PM.

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"