Copy and paste
Hi Eric, you are getting the error because you are copying the entire row and
then trying to paste it into a shorter space. It won't work that way so the
copy range has to be shortened to copensate for the omission of column A in
the paste area. Here is a modified code that I think will work for you. If
not, post back.
With Sheets("last four")
lr4 = Cells(Rows.Count, 2).End(xlUp).Row
lc4 = Sheets("lastfour").UsedRange.Columns.Count + 1
.Range(.Cells(lr4-3, 2), .Cells(lr4, lc4)).Copy
.Range("B9").PasteSpecial Paste:=xlValues, operation:=xlNone, _
skipblanks:=False, Transpose:=False
End With
"Eric" wrote:
I am using the following macro to copy the last four rows of information.
Here is the problem. The information starts in column "B" and I need to copy
it to cells("B9") Not cells("A9"). If I change cells("A9") to cells("B9") I
get an error, "area size doesn't match" or something to that effect. So
instead of copying the entire row I only want to copy from column B to column
AD. Any help would be appreciated thank you.
Eric
With Sheets("last four")
lr4 = Cells(Rows.count, 1)(Columns.count, 1).End(xlUp).Row
Rows(lr4 - 3 & ":" & lr4).Select
End With
Selection.Copy
Range("A9").Select
Selection.PasteSpecial Paste:=xlValues, operation:=xlNone, _
skipblanks:=False, Transpose:=False
|