Delete table name in Excel VBA -
i remove/delete name of table "table2" using excel vba. know how remove name hand, cannot figure out how set name "table2" name in vba. found other questions on topic codes deleted named ranges , remove table named "table2".
this code not working:
sub delete_name_table() dim n name n = "table2" n.delete end sub
anyone knows how set n correctly "table2"?
thanks!
you can backup data table, delete table , restore data.
sub test() dim rng range dim rngvals variant set rng = yoursheet.listobjects("table2").range rngvals = rng.value yoursheet.listobjects("table2").delete rng.value = rngvals set rng = nothing end sub
Comments
Post a Comment