Copy Row & Paste to Last Row in another WB - error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I am almost there, just running into an error. I am copying the row from
one workbook and pasting it to the last row in another. The column sizes are
different and I only want to paste the values. I am facing a copy area and
paste area are not the same size' error. Please help. Here is my code:

Rows("59:59").Select
Selection.Copy
Workbooks.Open Filename:= _
"C:\Documents and Settings\Mike\My Documents\testbook.xls"
Set rng = Range("B" & Rows.Count).End(xlUp).Offset(1, 0)
rng.PasteSpecial Paste:=xlValues, _
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.Save


thank you,
 
You are copying an entire row, then selecting a cell in column B and
pasting. Therefore the error is obvious. You need to select a cell in
Column A and then paste.
Either:-
In your code just change the offset from (1, 0) to (1, -1)

OR
Instead of Rows("59:59").Select use Range("B59:IV59").Select

Sharad
 
Back
Top