Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
a a is offline
external usenet poster
 
Posts: 51
Default Determining if a named range exists

Hello,

Is there a way to determine whether a named range exists in a workbook?
I would think there would be a way. I'm trying to put together an
if statement - but I don't know the syntax. What I'm looking for is "If
the range "first" exists in the workbook, then do this, else . . ."

Any help would be greatly appreciated.

Thanks in advance.

Anita

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Determining if a named range exists

Sub RangeNameTes()
Dim rng As Range

On Error Resume Next
Set rng = Range("myRangeNAme")
On Error GoTo 0
If Not rng Is Nothing Then
' it exists
Else
' it doesn't exist
End If

End Sub

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"a" wrote in message
nk.net...
Hello,

Is there a way to determine whether a named range exists in a workbook?
I would think there would be a way. I'm trying to put together an
if statement - but I don't know the syntax. What I'm looking for is "If
the range "first" exists in the workbook, then do this, else . . ."

Any help would be greatly appreciated.

Thanks in advance.

Anita



  #3   Report Post  
Posted to microsoft.public.excel.programming
a a is offline
external usenet poster
 
Posts: 51
Default Determining if a named range exists

Bob,

Thanks!

Anita

Bob Phillips wrote:

Sub RangeNameTes()
Dim rng As Range

On Error Resume Next
Set rng = Range("myRangeNAme")
On Error GoTo 0
If Not rng Is Nothing Then
' it exists
Else
' it doesn't exist
End If

End Sub


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
Validate Named Range Exists John Jost Excel Programming 5 December 5th 05 08:17 PM
Determining whether a named textbox on a chart exists P. Dua-Brown Excel Programming 4 October 20th 05 03:31 PM
how to tell if a named range exists Gixxer_J_97[_2_] Excel Programming 2 June 1st 05 07:38 PM
Determining if a Worksheet Exists Chaplain Doug Excel Programming 3 April 7th 05 10:00 PM
easy way to test if a Named Range exists Andrew Bauer Excel Programming 4 July 10th 03 07:32 PM


All times are GMT +1. The time now is 02:01 AM.

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"