Get Name of Selected Range
Charlie wrote:
Good Morning,
Is there a method or property that returns the Name (if any) of a selected
or specific range? Something like:
NameOfRange = ThisWorkbook.Names.Item(Selection).Name
NameOfRange = ThisWorkbook.Names.Item(ActiveCell).Name
NameOfRange = ThisWorkbook.Names.Item(Cells(1, 1)).Name
NameOfRange = ThisWorkbook.Names.Item(Range("A1")).Name
NameOfRange = ThisWorkbook.Names.Item(Range("A1:B2")).Name
TIA
Charlie
E.g.:
Sub testIt3a()
On Error Resume Next
MsgBox Selection.Name.Name
If Err < 0 Then MsgBox "The specified range is not a named range"
End Sub
Alan Beban
|