#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 74
Default Return cell name

Is there a function that will return the name of a cell not the contents? I
want to look up a team name in a list and get the named range (i.e. TEAM5)

Thanks
--
Jim T
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,344
Default Return cell name

I don't think you can do this with any of Excel's built in functions. With
VBA.
--
Cheers,
Shane Devenshire


"Jim Tibbetts" wrote:

Is there a function that will return the name of a cell not the contents? I
want to look up a team name in a list and get the named range (i.e. TEAM5)

Thanks
--
Jim T

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 74
Default Return cell name

I didn't think so. Thanks for the comeback.
--
Jim T


"ShaneDevenshire" wrote:

I don't think you can do this with any of Excel's built in functions. With
VBA.
--
Cheers,
Shane Devenshire


"Jim Tibbetts" wrote:

Is there a function that will return the name of a cell not the contents? I
want to look up a team name in a list and get the named range (i.e. TEAM5)

Thanks
--
Jim T

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Return cell name

Jim, I took a look around and found this solution originally posted by
Bob Phillips and Zack Barresse back in 2005:

Option Explicit
Option Compare Text
Public Function NAMEDRANGE(celRef) As String
Dim iName As Name, wbCall As Workbook
If TypeOf celRef Is Range Then
celRef = celRef.Address
End If
If Not celRef Like "*!$" Then
celRef = Application.Caller.Parent.Name & "!" & celRef
End If
Set wbCall = Workbooks(Application.Caller.Parent.Parent.Name)
For Each iName In wbCall.Names
If Not Intersect(Range(celRef), Range(iName.RefersTo)) Is Nothing
Then
NAMEDRANGE = iName.Name
Set wbCall = Nothing
Exit Function
End If
Next
NAMEDRANGE = "Not Found"
Set wbCall = Nothing
End Function

Called like ..
=NAMEDRANGE("Sheet1!$A$1")

See: http://www.pcreview.co.uk/forums/thread-2090701.php for the
original post.

Hope this helps,

David

Jim Tibbetts wrote:

Is there a function that will return the name of a cell not the contents? I
want to look up a team name in a list and get the named range (i.e. TEAM5)

Thanks
--
Jim T


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
insert date Larry Excel Worksheet Functions 28 July 15th 06 02:41 AM
Return value in cell above the reference Jean Excel Discussion (Misc queries) 4 May 31st 06 07:50 PM
help with index to return particular cell value Allan from Melbourne Excel Discussion (Misc queries) 0 May 27th 06 03:20 AM
How do you make cell 2 return data if cell 1 contains text? jermsalerms Excel Discussion (Misc queries) 3 January 5th 06 10:44 PM
Select cell, Copy it, Paste it, Return to Previous cell spydor Excel Discussion (Misc queries) 1 December 30th 05 01:29 PM


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