PC Review


Reply
Thread Tools Rate Thread

check if name object exists

 
 
mark kubicki
Guest
Posts: n/a
 
      18th Jan 2007
is there a function to see if a name object exists?


(thanks in advance)


 
Reply With Quote
 
 
 
 
Chip Pearson
Guest
Posts: n/a
 
      18th Jan 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> is there a function to see if a name object exists?
>
>
> (thanks in advance)
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check object exists if it raises error? Mark Berry Microsoft C# .NET 4 15th Jun 2007 11:53 PM
Check to see if object instance exists Larry Microsoft C# .NET 2 21st Feb 2007 04:59 PM
Check if a table object exists =?Utf-8?B?TWFyaWVU?= Microsoft Access VBA Modules 1 27th Sep 2006 07:12 PM
Member already exists in an object module from which object derive =?Utf-8?B?THVjaw==?= Microsoft Access Form Coding 2 8th Dec 2004 12:09 AM
Can you check if an object exists, and only it it does, delete it =?Utf-8?B?Q3JhaWc=?= Microsoft Access Macros 2 19th Dec 2003 01:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:30 AM.