Sub Main()
If NameExists("SalesData") Then
MsgBox "Name Exists"
Else
MsgBox "Name does not exist"
End If
End Sub
Function NameExists(myName As String) As Boolean
Dim X As String
On Error Resume Next
X = Names(myName).RefersTo
If Err.Number <> 0 Then
NameExists = False
Err.Clear
Else
NameExists = True
End If
End Function