I am trying to copy and paste data from one sheet to another but under the current data. The destination for the paste will vary as I want it to be pasted below the last row of data already in that range. I start by filtering data in the origin sheet, copying it and pasting it in destination sheet. For example I want the new data (B2:D & lastrow) from origin sheet to be pasted in columns (G:I & newlastrow) in the destination sheet under the current data in there.
I have tried the following and currently I am getting a problem with the range.
Sub copytoderiv()
Dim lastrow As Long
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
ActiveWorkbook.Sheets("origin").Activate
Call TURNFILTERSOFF
Sheets("origin").Range("$A$1:$D$50000").AutoFilter Field:=1, Criteria1:="XXX"
ActiveSheet.Range("B2:D" & lastrow).SpecialCells(xlCellTypeVisible).Copy
Dim Newlastrow As String
ActiveWorkbook.Sheets("destination").Activate
Newlastrow = ActiveSheet.Cells(Rows.Count, "H").End(xlUp).Row + 1
Range("G:I" & Newlastrow).Select
ActiveSheet.PasteSpecial
Call TURNFILTERSOFF
End Sub