Created
August 18, 2016 12:46
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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