I'm trying to cut the data from all the rows until the last one from sheet "Summary" and paste it to the next blank row in the "Historical" sheet, but im getting this error: PasteSpecial method or Range class failed.
Sub HistoricalData()
Application.ScreenUpdating = False
Dim copySheet As Worksheet
Dim pasteSheet As Worksheet
Dim LastRow As Integer
LastRow = Sheets("Summary").Range("A" & Rows.Count).End(xlUp).row
Set copySheet = Worksheets("Summary")
Set pasteSheet = Worksheets("Historical")
copySheet.Range("A2:V2" & LastRow).Cut
pasteSheet.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
Thanks in advance !
PasteSpecial
in a wrong way. If you cut the data you cannot use pastespecial. You should first copy the data andPasteSpecial
with Values and after that you can delete the same range. – MikkuRange("A2:V" & LastRow
. – BigBen