View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Determining if a named range exists

Sub RangeNameTes()
Dim rng As Range

On Error Resume Next
Set rng = Range("myRangeNAme")
On Error GoTo 0
If Not rng Is Nothing Then
' it exists
Else
' it doesn't exist
End If

End Sub

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"a" wrote in message
nk.net...
Hello,

Is there a way to determine whether a named range exists in a workbook?
I would think there would be a way. I'm trying to put together an
if statement - but I don't know the syntax. What I'm looking for is "If
the range "first" exists in the workbook, then do this, else . . ."

Any help would be greatly appreciated.

Thanks in advance.

Anita