View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jake Marx[_3_] Jake Marx[_3_] is offline
external usenet poster
 
Posts: 860
Default how do i test for the existence of a range name

Hi rrobelen,

You can simply trap the error that may occur if it doesn't exist:

Public Function gbDoesNameExist(rwb As Workbook, _
rsName As String) As Boolean
On Error Resume Next
gbDoesNameExist = Len(rwb.Names(rsName).Name)
On Error GoTo 0
End Function

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


rrobelen wrote:
I know this must be trivial but I can't find it. How do i test to
see that a range name exists?