D
DoooWhat
This macro allows me to name cells very easily:
Sub NameCells()
Dim w As String
Dim cell As Range
w = Cells(ActiveCell.Row, 1) & "_" & Cells(2, ActiveCell.Column)
w = Replace(w, "& ", "")
' several other replacements that I omitted for brevity's
sake
ThisWorkbook.Names.Add Name:=w, _
RefersTo:=ActiveCell, _
Visible:=True
End Sub
The trouble is that I have to click the macro in each cell that I want
to name. I am using this on financial statements, and I have to do it
about 200 times every time I import a new set. Is there any way to
loop this so that I can select a range of cells, and it will
automatically name all of them based on the above criteria?
Sub NameCells()
Dim w As String
Dim cell As Range
w = Cells(ActiveCell.Row, 1) & "_" & Cells(2, ActiveCell.Column)
w = Replace(w, "& ", "")
' several other replacements that I omitted for brevity's
sake
ThisWorkbook.Names.Add Name:=w, _
RefersTo:=ActiveCell, _
Visible:=True
End Sub
The trouble is that I have to click the macro in each cell that I want
to name. I am using this on financial statements, and I have to do it
about 200 times every time I import a new set. Is there any way to
loop this so that I can select a range of cells, and it will
automatically name all of them based on the above criteria?