Hi there
Below is some code that I'm trying to get to work. It only works on the 1st cell in my selection, instead of all the cells I've selected.
What am I missing?
Sub NameFromCell ()
Dim cell As Range
For Each cell In Selection
ActiveWorkbook.Names.Add Name:=ActiveCell.Range("A1") & "_", RefersToR1C1:=ActiveCell
Next cell
End Sub
Below is some code that I'm trying to get to work. It only works on the 1st cell in my selection, instead of all the cells I've selected.
What am I missing?
Sub NameFromCell ()
Dim cell As Range
For Each cell In Selection
ActiveWorkbook.Names.Add Name:=ActiveCell.Range("A1") & "_", RefersToR1C1:=ActiveCell
Next cell
End Sub