try
Selection.name = "LocCode"
Do you realise that
selection.cells(2,4).value
is the value in the cell 3 across to the right and one down from
selected cell?
Your code will leave you with a variable called LocCode containing
whatever was in that cell 3 across & 1 down, and a named range called
LocCode on the active sheet.