View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Andrew Bauer Andrew Bauer is offline
external usenet poster
 
Posts: 2
Default easy way to test if a Named Range exists

Is there an easier way to test if a Named Range exists
than this loop:

'a long-winded way to check if "ToolVersion" exists...
fnd = False
For Each x In ActiveWorkbook.Names
If x.Name = "ToolVersion" Then
fnd = True
Exit For
End If
Next x

I need something like this:
if ActiveWorkbook.Names.Item("x").Exists then ...