Hi. I'm new to your forum; an amateur VBA programmer from the Houston area.
I recorded this code in an attempt to create and format a table in Excel 2010.
When the ActiveSheet.ListObjects.Add(xlSrcRange, Selection, , xlYes).Name = "Master_List" statement executes, I get a runtime error 1004: "A table cannot overlap a range that contains a PivotTable report, query results, protected cells, or another table. "
Earlier in the code I do import a .csv file to the range I'm trying to turn into a table. Looking in the name manager, it appears that every time the import runs, a new name gets created: inserts, inserts_1, inserts_2, etc. I think if I could delete these names (are they listobjects?) after the insert this problem might go away. In any case, I'd like to clean up after myself.
Any suggestions?
Thanks for any help.
Bookmarks