Table Name

  • Thread starter Thread starter Mike H.
  • Start date Start date
M

Mike H.

How do I get the name of the current table? I am talking about when I use
the Home>Format as Table (In the Styles section) and then format data as a
table. Typically Excel assigns the name Table1, Table2, etc. How can I
determine the table name in VBA?
 
here you go
ActiveSheet.ListObjects.Add(xlSrcRange,
Range(ActiveCell.CurrentRegion.Address), , xlYes).Name = "ABCD1"

But the only catch over here is your cursor should be with in the table.
I mean if you have data in range "A1:E40", then your cursor should be with
in this range. If the cursor is in cell F3 then this code will work but not
as you want it to.

regards
Heera Chavan
 
Back
Top