I want to change the size of the object tables through VBA, I tried modifying the code from MSDN about the listobject.resize
method, but I want to dynamically if a data loaded in 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