Guys -
I have inherited a spreadsheet with hundreds of redundant named ranges. I want to delete them all via VBA. I did the usual by using nm.Delete where nm is the variable Name object. It works fine except that there are names which have blanks embedded, eg. "Direction_20_1_ 2" or "South 23_1_34". The VBA code produces an exception error because of the blanks. How the names got in there in the first place beats me. Is there a way within VBA to change the name? If not, can anyone please think of another solution? Deleting them (there are around a hundred) from Excel's Name Manager is possible but I will have to do this exercise every time I get a fresh copy - and that is outside my control.
Many thanks, ramridge
I have inherited a spreadsheet with hundreds of redundant named ranges. I want to delete them all via VBA. I did the usual by using nm.Delete where nm is the variable Name object. It works fine except that there are names which have blanks embedded, eg. "Direction_20_1_ 2" or "South 23_1_34". The VBA code produces an exception error because of the blanks. How the names got in there in the first place beats me. Is there a way within VBA to change the name? If not, can anyone please think of another solution? Deleting them (there are around a hundred) from Excel's Name Manager is possible but I will have to do this exercise every time I get a fresh copy - and that is outside my control.
Many thanks, ramridge