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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
something like activecell.entirerow.select then selection.copy
 
Last edited:
Upvote 0
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,214,585
Messages
6,120,390
Members
448,957
Latest member
Hat4Life

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