Paste Special throwing an error

J

jlclyde

I ahve been using this code for almost a year wothout any trouble.
Recently it started to throw an error when it gets to the paste
special line. The error says "PasteSpecial method of class range
failed". Here is my code.

Thanks,
Jay

Sub Cutting()
Dim NextRow As Long
Dim Datei As Date
Datei = Range("E1")

Range("A7:AB26, BL7:BM26").Copy
Application.ScreenUpdating = False
Workbooks.Open filename:="G:\DPE-IPE\DPE REVISIONS\All Press Ips.xls"
Sheets("Cutting").Activate
NextRow = Range("B65536").End(xlUp).Row + 1

Range("B" & NextRow).PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks:=False, Transpose:=False

Dim theRange As Range
Dim lastRow&, firstRow&, x&
Set theRange = ActiveSheet.UsedRange
lastRow = theRange.Cells(theRange.Cells.Count).Row
firstRow = NextRow
For x = lastRow To firstRow Step -1
If Cells(x, 7) = "" And Cells(x, 12) = "" And Cells(x, 16) = "" _
And Cells(x, 20) = "" And Cells(x, 24) = "" And Cells(x, 28) =
"" Then
Rows(x).Delete
End If
Next
Sheets("Cutting").Range("A" & NextRow).Resize(Range(Range("B" &
NextRow), Range("B65536").End(xlUp)).Count, 1) = Datei

Workbooks("All Press Ips.XLS").Close SaveChanges:=True

End Sub
 

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

Similar Threads

HELP Copy And Paste 7
R1C1 1
R1C1 0
automatic page break 1
end it 2
Can not set WorkBook variable 5
VBA to delete a row based on rows being filled. 1
Calcutate SUM of column in first blank row 5

Top