runtime error 1004 pastespecial method of range class failed

forginganewone

Board Regular
Joined
Mar 14, 2018
Messages
64
I keep getting this error "runtime error 1004 pastespecial method of range class failed" on following code :

Option Explicit

Sub copypasterow()
'
' chequerecieving Macro
' copy active row to another workbooks last row
'
' Keyboard Shortcut: Ctrl+l
'
Dim wbTarget As Workbook
Selection.EntireRow.Copy
Set wbTarget = Workbooks.Open("D:\Office\Rental Cheques\Recieving\Recieving File 1\Recieving file 1.xlsx")
wbTarget.Sheets("Sheet1").Range("C1").End(xlDown).Offset(1, 0).PasteSpecial
Application.CutCopyMode = False

End Sub



Please help :(
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I suppose you could have a shape or something selected which would produce an error but that would be an obvious mistake. But you need to do something like:

Code:
wbTarget.Sheets("Sheet1").Range("C" & Rows.Count).End(xlUp).Offset(1, -2).PasteSpecial xlPasteValues
 
Upvote 0
It Doesn't do that, it just goes at the bottom of C column and pastes the row where blank cell appears in C (mainly the last row)
I

Yes i know. But if you copy a whole row you have to paste it into column A. You cannot paste it into column C. It wont fit.
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,262
Members
452,627
Latest member
KitkatToby

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top