View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_3_] Bob Phillips[_3_] is offline
external usenet poster
 
Posts: 2,420
Default VBA Excel range name test

Why not just delete your selected names, existing or not?

On Error Resume Next
Activeworkbook.Names("name1").Delete
Activeworkbook.Names("name2").Delete
On Error Goto 0

--
__________________________________
HTH

Bob

"Marie" wrote in message
...
Is it possible to test in VBA whether a rangename (created in excel)
exists?
And therefore run a macro which then deletes only those rangenames which
already exist . Do not wish to dlete all range names just a selection.

This is because the macro creates rangenames to use in the procedure for
copying/formula/prints etc various bits of information and depending how
long the datasheet is the number of ranges may be anything from 1 to 10
but i
wish to start the macro always with none of the "macro created" range
names
from its previous execution existing