Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Show field or range name in a cell
Hi. I'm trying to keep all my naming conventions documented, so I've set up a sheet in my work book listing all the cell or range names I've created.
Is there any way to have a cell show the assigned name of another cell? Can this formula be put directly in the cell example =name($B$1) Thanks |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Show field or range name in a cell
Not with anything built into excel.
But you could create a userdefined function that could return that name. Option Explicit Function myName(rng As Range) As String Application.Volatile True On Error Resume Next myName = rng.Name.Name On Error GoTo 0 End Function This kind of function could be one calculation behind. If the Name changes (or gets created), then you'll want to force a recalculation before you believe the results. Application.volatile true means that excel will recalculate each of these formulas each time excel recalculates. You may notice a slowdown in your workbook. If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm Short course: Open your workbook. Hit alt-f11 to get to the VBE (where macros/UDF's live) hit ctrl-R to view the project explorer Find your workbook. should look like: VBAProject (yourfilename.xls) right click on the project name Insert, then Module You should see the code window pop up on the right hand side Paste the code in there. Now go back to excel. Into a test cell and type: =myName(a1) ========== Remember that ranges/cells can have more than one name and that a single cell could be part of lots of ranges. So you may not get the name you expect. If this is to help you develop a workbook (checking purposes), then don't use this. Get a copy of Jan Karel Pieterse's (with Charles Williams and Matthew Henson) Name Manager: You can find it at: NameManager.Zip from http://www.oaltd.co.uk/mvp If you use names, this will make you're life easier. Michael Excel Dude wrote: Hi. I'm trying to keep all my naming conventions documented, so I've set up a sheet in my work book listing all the cell or range names I've created. Is there any way to have a cell show the assigned name of another cell? Can this formula be put directly in the cell example =name($B$1) Thanks -- Michael Excel Dude -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cell Reference with Range Name | Excel Worksheet Functions | |||
How do I total range of cells that have checks in checkboxes? | Excel Discussion (Misc queries) | |||
How can I show all field data in a pivot table, instead of blank | Excel Discussion (Misc queries) | |||
macro help | Excel Discussion (Misc queries) | |||
Possible Lookup Table | Excel Worksheet Functions |