I saw this code and its great but the range is predetermined

If I want the name to be the one i selected from the list box, how would I do that? Anyone... Please

POPULATE LIST BOX -WORKS FINE.
----------------------------------------------
Private Sub CommandButton1_Click()
With ListBox1
For Each nme In ActiveWorkbook.Names
.AddItem nme.Name
Next nme
End With
End Sub
----------------------------------------------

BUT NEED TO TAKE VALUE FROM ABOVE / as selected RANGE NAME...in sttead of ("A1:A20")
Sub makeFile()

Dim ce As Range

Open "c:\codes.txt" For Output As #1

For Each ce In Range("A1:A20")
Write #1, ce.Value

Next ce

Close #1

End Sub