How do I check to see if a named range exists in VB
range TSF for example?
Thanks
How do I check to see if a named range exists in VB
range TSF for example?
Thanks
Last edited by Cbrehm; 05-07-2011 at 08:11 AM.
To check the existence of the named range 'snb':
![]()
Sub tst() msgBox [isref(snb)] End Sub
Last edited by snb; 05-07-2011 at 07:41 AM.
Alternative as UDF
The following VBA procedure will return TRUE if the name specified in TheName exists, or will return FALSE otherwise.
[/code]
Function NameExists(TheName As String) As Boolean
On Error Resume Next
NameExists = Len(ThisWorkbook.Names(TheName).Name) <> 0
End Function[/code]
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks