Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default Paste Special throwing an error

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
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
copy and insert throwing error- help in code req dee Excel Discussion (Misc queries) 8 March 6th 08 10:57 PM
aconcat UDF throwing a #NAME error Josh Rogers Excel Worksheet Functions 10 February 14th 08 08:29 PM
Special Paste Error...Data pastes into one column School Excel Discussion (Misc queries) 1 October 17th 07 07:48 PM
When paste special links the file name gives error Engineering Accountant Excel Discussion (Misc queries) 2 September 27th 06 11:05 PM
In Excel: add a Paste-Special Option to paste IN REVERSE ORDER. stan-the-man Excel Worksheet Functions 7 June 14th 06 09:10 PM


All times are GMT +1. The time now is 06:00 AM.

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"