Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Range Name Found??

If I wanted to check to see if a range name exists would I do?



--
Thank you for your help in advance!!! (smile)

Mike


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Range Name Found??

Micheal,

Here is a function (with a test sub) that will return t/or/f if your name
exists:

Sub Test()
MsgBox RangeNameExists("test")
End Sub

Function RangeNameExists(sRangeName As String) As Boolean
Dim rng As Range
On Error Resume Next

Set rng = Range(sRangeName)

If Not rng Is Nothing Then
RangeNameExists = True
End If

End Function


--
Charles
www.officezealot.com


"Michael Kintner" wrote in message
...
If I wanted to check to see if a range name exists would I do?



--
Thank you for your help in advance!!! (smile)

Mike




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Range Name Found??

Hi Michael,

Here's another alternative (shorter, but accomplishes the same thing as
Charles's):

Public Function gbValidRange(rsName As String) As Boolean
On Error Resume Next
gbValidRange = Len(Range(rsName).Name)
End Function

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

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


Michael Kintner wrote:
If I wanted to check to see if a range name exists would I do?


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
Sum vales found with a date range. Will Excel Discussion (Misc queries) 7 April 9th 07 10:52 PM
Conditional format if cell match found in another range of cells Nolene Excel Worksheet Functions 2 October 5th 06 06:56 AM
Conditional formatting if value in cell is found in a named range Grumpy Grandpa Excel Worksheet Functions 5 April 15th 06 04:30 PM
Validation error: Says range not found and it is there? JMike Excel Discussion (Misc queries) 1 February 11th 05 06:35 PM


All times are GMT +1. The time now is 02:12 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"