Put Name's Refer's to: field in cell
Rick
Wow, you give new meaning to technical support !
Yes but, as it turns out, that support is not very good.<g I took a
shortcut and did all my testing with Defined Names being ranges. It appears
that when a formula is assigned to a Defined Name, the name object cannot be
passed without the quote marks as Excel evaluates the formulas before
passing it as an argument. So, as long as we acknowledge the argument must
be quoted, then this simple UDF seems like it should work...
Function GetRefersTo(DefinedName As String) As Variant
If Not Names(DefinedName) Is Nothing Then _
GetRefersTo = Mid(Names(DefinedName).RefersTo, 2)
End Function
Note that the function is a one-liner... I used the line continuation
character to avoid having the message possibly be word-wrapped at an awkward
spot.
Rick Rothstein (MVP - Excel)
|