I am trying to paste info on the last row of a different worksheet. I already have the info copied and this macro is just to paste it. With the code that I have now, I am getting an error that says "Paste Method of Worksheet Class Failed" how can I fix this?
here is the code:
Windows("m.xlsx").Activate
Cells(Application.Rows.Count, 1).End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Range("D45").Select
Windows("d.xlsx").Activate
Excel is known to clear the clipboard and hence you should put the copy command one line before you paste.
So in your case the copy command will go before
Also please avoid the use of
.Select/Activate
. Please read How to avoid using Select in Excel VBA macrosIs this what you are trying (Untested)?