Thread: Table Name
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Heera Chavan[_2_] Heera Chavan[_2_] is offline
external usenet poster
 
Posts: 18
Default Table Name

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

"Mike H." wrote:

How do I get the name of the current table? I am talking about when I use
the HomeFormat 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?