Paste Failed

N

Nathan Bell

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
 
D

Don Guillett

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top