Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default checking if a range has a name.

Hello everyone,

Let's say I have given the name "automobile" to cell B7.
If that cell is selected at a certain moment, is is possible to retrieve the
name "automobile" that has been given to it?

I'd like to do something along the lines of (free styling) :
if the name of the active cell =
"automobile" then .... etc. etc.

Does anyone have code for this kind of thing?

Thanks,
Peter


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default checking if a range has a name.

Maybe:

Option Explicit
Sub testme()

Dim myName As String
myName = ""
On Error Resume Next
myName = ActiveCell.Name.Name
On Error GoTo 0

If myName = "" Then
MsgBox "no name"
Else
MsgBox "It's: " & myName
End If
End Sub



Peter wrote:

Hello everyone,

Let's say I have given the name "automobile" to cell B7.
If that cell is selected at a certain moment, is is possible to retrieve the
name "automobile" that has been given to it?

I'd like to do something along the lines of (free styling) :
if the name of the active cell =
"automobile" then .... etc. etc.

Does anyone have code for this kind of thing?

Thanks,
Peter


--

Dave Peterson
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
Checking a cell against a named range Memento Excel Worksheet Functions 8 April 7th 07 01:46 PM
Checking a range with IF Rob J Excel Discussion (Misc queries) 4 October 18th 06 05:44 PM
Checking if a certain day falls in a range Jaydubs Excel Discussion (Misc queries) 6 March 16th 06 01:51 PM
Checking ALL values in a range nospaminlich Excel Discussion (Misc queries) 13 February 10th 05 09:29 AM
Checking range names Kenneth Brown Excel Programming 1 September 1st 04 02:22 PM


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