Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default check if name object exists

is there a function to see if a name object exists?


(thanks in advance)


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default check if name object exists

Try a function like


Function NameExists(WhatName As String) As Boolean
Dim S As String
On Error Resume Next
S = ThisWorkbook.Names(WhatName).Name
NameExists = (Err.Number = 0)
End Function

You call this with code like

If NameExists(WhatName:="MyRangeName") = True Then
' whatever
Else
' something
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"mark kubicki" wrote in message
...
is there a function to see if a name object exists?


(thanks in advance)



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
check if sheet exists mohavv Excel Discussion (Misc queries) 1 November 21st 07 01:58 AM
check if the sheet/tag exists Alex Excel Worksheet Functions 2 March 14th 06 08:58 PM
How to check from VBA if sheet exists? Alen Excel Programming 2 March 2nd 06 12:36 PM
verifying an object exists JT[_2_] Excel Programming 1 December 30th 04 03:01 AM
Checking to see if a Range Object exists? debartsa Excel Programming 2 January 20th 04 06:13 PM


All times are GMT +1. The time now is 08:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"