PDA

View Full Version : Unlist Table



souldrin
11-01-2007, 08:36 AM
I need to convert a table to a range in VBA. When I record a macro I get the following code.

Range("F16").Select
Application.CutCopyMode = False
ActiveSheet.ListObjects("Table_ExternalData_1181").Unlist

I was hoping it would convert any table that existed at the selected cell but I guess it calls the table up by name and then converts it. Is there a way to change it so that I can convert any table that happens to exist at the selected cell? Also, is there a way to call for a list of currently existing table names that will return names I can use to unlist if I want to do it by name instead? I?m using Office 2007 but I?m making the sheet so that it works in 2003 as well.
Thanks

Bob Phillips
11-01-2007, 08:44 AM
This gives the names which is what I think that you mean



Worksheets("Sheet1").Range("A1").ListNames