Assuming this is for development and not deployment, why not just put a UDF in Personal to do this?
[TABLE="class: grid"]
<tbody>[TR]
[TD="bgcolor: #C0C0C0"][/TD]
[TD="bgcolor: #C0C0C0"]A
[/TD]
[TD="bgcolor: #C0C0C0"]B
[/TD]
[TD="bgcolor: #C0C0C0"]C
[/TD]
[/TR]
[TR]
[TD="bgcolor: #C0C0C0"]1
[/TD]
[TD]myCol[/TD]
[TD="bgcolor: #E5E5E5"](Workbook) Sheet1!myCol Refers To: =Sheet1!B:B[/TD]
[TD]B1: =sGetname(A1)[/TD]
[/TR]
[TR]
[TD="bgcolor: #C0C0C0"]2
[/TD]
[TD]myRow[/TD]
[TD="bgcolor: #E5E5E5"](Workbook) Sheet1!myRow Refers To: =Sheet1!2:2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #C0C0C0"]3
[/TD]
[TD]relN[/TD]
[TD="bgcolor: #E5E5E5"](Workbook) Sheet1!relN Refers To: =Sheet1!B2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="bgcolor: #C0C0C0"]4
[/TD]
[TD]Bob[/TD]
[TD="bgcolor: #E5E5E5"]Sheet4!Bob Refers To: =Sheet4!$A$1[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
This is for personal use only, so it doesn't need to pass any international code standards.
I guess I'm too dense. I don't understand what to put in the UDF. Is there a VBA function that will return the name given the range? Maybe something like:
Code:
Dim sName as String
sName = RangeName("$2:$2")
I tried these:
Code:
?range("$2:$2").Address
$2:$2
?range("$2:$2").ApplyNames
?range("$2:$2").ID
?range("$2:$2").ListNames
True
?range("$2:$2").name
='1 loss'!$2:$2
?range("$2:$2").Range
Some got errors. None returned "HeaderRow".
Here's a simplified version of my sheet:
[TABLE="class: grid, width: 400"]
<tbody>[TR]
[TD="align: center"]R/C[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[TD="align: center"]I[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: right"]HdrRow[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]Sum[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: right"]NumEvents[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]7[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]38[/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: right"]Percent[/TD]
[TD="align: center"]8%[/TD]
[TD="align: center"]13%[/TD]
[TD="align: center"]32%
[/TD]
[TD="align: center"]18%[/TD]
[TD="align: center"]29%[/TD]
[TD="align: center"]100%[/TD]
[/TR]
</tbody>[/TABLE]
The labels in Col C are the names assigned to those rows. For example, "$4:$4" is assigned the name "HdrRow".
I would like to replace the literal text in Col C with a formula or function that will return the exact same result.