NorthbyNorthwest
Board Regular
- Joined
- Oct 27, 2013
- Messages
- 154
- Office Version
- 365
Hi, everyone. I haveExcel template (xltm). I create eachweek a new workbook which contains an Excel table, aka list object, Itransfer/paste data to from another source daily. The new workbook starts with only one list row. I need to copy to first row on Monday, andthen Tuesday thru Friday I need to copy to next row (in other words, append toend/bottom of table. When I use thefollowing line of code on Tuesday thru Friday it works great:
But on Monday, it creates a second row and copies toit. I realize my code is asking it toinsert a row. But I don’t know how totest the list object for a first row and select it. I’ve tried to research myself. But nothing I come up with seems towork. Can someone help?
VBA Code:
Dim oNewRow as ListRow
Set oNewRow =Selection.ListObject.ListRows.Add(AlwaysInsert:=True)
But on Monday, it creates a second row and copies toit. I realize my code is asking it toinsert a row. But I don’t know how totest the list object for a first row and select it. I’ve tried to research myself. But nothing I come up with seems towork. Can someone help?
Last edited by a moderator: