Skip to content

Instantly share code, notes, and snippets.

@RichPollock
Created August 18, 2016 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RichPollock/ea30219979e2fd4125dd8e0418a14bfa to your computer and use it in GitHub Desktop.
Save RichPollock/ea30219979e2fd4125dd8e0418a14bfa to your computer and use it in GitHub Desktop.
Creates named ranges to each cell using the content of the cell as the name
Sub NameCellRangesAfterCellContent()
Dim columnNumber As Integer
columnNumber = 2
For i = 1 To 100
If Sheets("Sheet Name").Range("A" & i).Value <> "" Then
ActiveWorkbook.Names.Add Name:=Sheets("Sheet Name").Range("A" & i).Value, RefersToR1C1:="='Sheet Name'!R" & i & "C" & columnNumber
End If
Next i
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment