Hi,
I have the following macro which will copy populated rows in sheet 'MLS' and paste them in the first empty row after A20 in 'SalesDB'.
However, rather than just paste the values, I'd like it to insert the rows at the first empty cell after A20.
Can anyone offer any advice what to modify in order to achieve this?
Sub CopyPasteSales()
Dim salesData As Range, targetRng As Range
Set salesData = Worksheets("MLS").Range("A1:G" & Range("A1").End(xlDown).Row)
If Worksheets("SalesDB").Range("A20") = vbNullString Then
Set targetRng = Worksheets("SalesDB").Range("A20")
Else
Set targetRng = Worksheets("SalesDB").Range("A20").End(xlDown).Offset(1, 0)
End If
salesData.Copy Destination:=targetRng
End Sub
Many thanks
Bookmarks