Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Return the name of a range in a sheet formula
Try the following VBA function in a standard code module. It will return the
name of the specified cell, if it is named. If the cell is not named, it returns a #VALUE error. If you pass in a range of more than one cell, it returns a #REF error. Function NameOfCell(Rng As Range) As Variant Dim S As String On Error Resume Next If Rng.Cells.Count 1 Then NameOfCell = CVErr(xlErrRef) Else S = Rng.Name.Name If Err.Number < 0 Then NameOfCell = CVErr(xlErrValue) Else NameOfCell = S End If End If End Function -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) "XP" wrote in message ... In Excel 2003, is it possible to enter a formula in a sheet that returns the NAME of a named range. In this case, the named range is a single cell. Is it also possible to return the name given to a cell within that cell, for example, if B5 was named L50A enter some formula in B5 to return "L50A"? Thanks for the assist. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I use a formula to return the first number in a range? | Excel Worksheet Functions | |||
Any formula to return the most frequent bin range? | Excel Discussion (Misc queries) | |||
formula to return a $ amount for a range of % | New Users to Excel | |||
Formula - Analyse range, return unique value | Excel Worksheet Functions | |||
Input box doesn't return sheet name with range | Excel Programming |