View Single Post
 
Old 11-09-2019, 05:59 AM
p45cal's Avatar
p45cal p45cal is offline Windows 10 Office 2019
Expert
 
Join Date: Apr 2014
Posts: 866
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

You have a named range mt so you could:
Code:
Set tbl = Range("mt").ListObject
but your mt named range is itself based on a table name.
If you know where the table is you can use any cell of that table to refer to the table:
Code:
Set tbl = Sheets("Sheet1").range("A1").listobject
Of course you can bypass setting the tbl object variable with:
Code:
Sheets("Sheet1").Range("A1").ListObject.ListRows.Add
Reply With Quote