More a question of writing nice VBA code here, since it technically works. I have a simple task - I need to copy data from one ListObject (2 columns from 4-column table) and add it to the end of another 2-column table (and have the Excel table autoexpand).
I created Range Trans_log, for addressing those 2 columns I need to copy. I'm targeting the newly created ListRow through newrow, in order not to accidentially paste data somewhere in the middle of the table.
However is there a neater way to do this, instead of using With, .Activate and ActiveCell ?
Sub Copy()
Dim newrow As ListRow
Set newrow = ActiveSheet.ListObjects("Log").ListRows.Add
ActiveSheet.Range("Trans_log").Copy
With newrow
.Range(1).Activate
ActiveCell.PasteSpecial xlPasteValues
End With
End Sub