I don’t think I can use Intersect because the selected range does have a Named range specifically for it, but the selected range will also be part of another Named range
Eg
So due to the Intersect problem I thought the below would give me what I’m after.
From https://stackoverflow.com/questions...u-get-a-specific-name-associated-with-a-range
Eg
Rich (BB code):
Select cells are "C97:C98" and Range Name = "NameMe"
But I have another Range Name, "NamesAll" that refers to "C2:C100"
From https://stackoverflow.com/questions...u-get-a-specific-name-associated-with-a-range
Rich (BB code):
However, it bugs out with;
Error 1004
Application-defined or object-defined error
VBA Code:
Sub TestAddress()
Dim n As Name
For Each n In ActiveWorkbook.Names
If n.RefersToRange.Address = "C97:C98" Then 'This line bugs out
Debug.Print n.Name
End If
Next
End Sub