I want to resize object tables via VBA, I tried to change the code from MSDN about the method listobject.resize, but I want to dynamically if the data is loaded into each row.
The code I'm trying, but to no avail:
Sub resizedata()
Dim ws As Worksheet
Dim ob As ListObject
Dim Lrow1 As Long
Lrow1 = Sheets("db_goods").Cells(Rows.Count, "E").End(xlUp).Row
Set ws = ActiveWorkbook.Worksheets("db_goods")
Set ob = ws.ListObjects("Table1")
ob.Resize Range("A1" & Lrow1)
End Sub

source
share