Here is an alternative solution using built-in functionality.
[VBA]
Sub AutoNameCreate()
If Selection(1, 1).Row <> 1 Then
Selection.Offset(-1, 0).Resize(Selection.Rows.Count + 1).CreateNames _
Top:=True
End If
End Sub[/VBA]
Interestingly, when I tested this, Jake's method failed for me. I haven't tested extensively but it seems that approach doesn't like embedded spaces in the cell to get the name from, wereas CreateNames substitutes an underscore. I need to test this some more, I wasn't aware of this.




Reply With Quote