I have a macro that works well for deleting specific columns from a worksheet when the column heading does not match a subset of specific names. The drawback with my approach is that the subset of names is embedded within the macro and requires the macro to be changed if the list of chosen names changes. What I would like to do is use a defined Range Name in the worksheet to define the list of column names not to delete, so that when the names in the Range or the size of the Range changes the macro updates automatically via reference to the Named Range.
The existing macro is:
I attach a sample worksheet that contains a Named Range "Word_Choice" that I would like the macro to reference instead of the hardcoded macro line "varList = VBA.Array("Answer", "Comparison", "Harbor", "Judge", "Man", "Meal", "Paint", "Religion", "Request", "Science", "Story")"
Any help will be greatly appreciated.