To add a range name based on a selection using a variable
Sub AddName3() Dim rngSelect As String rngSelect = Selection.Address ActiveSheet.Names.Add Name:="MyRange3", RefersTo:="=" & rngSelect End Sub