View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
donbowyer donbowyer is offline
external usenet poster
 
Posts: 107
Default Odd numbered Range Names ?

I have a macro program aimed at deleting unwanted range names.
The intent is for the program to cycle through each range name until it
finds one meeting my delete criteria, delete it then move on.
Suppose I have 10 range names (eg MyRange_1 thru MyRange_10), all meeting my
delete criteria, to remove.
The macro runs OK, but only selects and deletes EVEN numbered range names.
If I then run the program again, it removes numbers 1, 5 & 9, leaving 3 & 7.
Running again removes 3
Running again removes 7

I use "MyName = Names(X).Name" to cycle through,
where X is from "For X= 1 to 10 Step 1"

I feel there is something I don't understand about how Excel stores range
names.
How can I make my program delete all in one pass?
Any suggestions most welcome.

--
donwb