Excel VisualBasic Script

Sub GetSelectionAddress()
    ActiveSheet.Names.Add Name:="MyRange2", RefersTo:="=" & Selection.Address()
End Sub