Using a value in a cell to name a row

Excel_ent1

New Member
Joined
Mar 6, 2019
Messages
2
Hi guys,

I want to be able to use a value in a cell to give a ROW a named range name.

The reason : I have 500 of them to name. I can easily dynamically pop the name I want for the row in a cell ( in this case I column G).

Ideally, I want to write a macro to step through the rows, where it see's a value, name that ROW the value of the cell ?

make sense ? hope so.

i.e - start at g1, if null - do nothing, if NOT null then get row number and NAME that row the value of the column. from row 1 to 70K. (big I know).

Is this possible ? and tips ? anyone done this before ?

Hope you guys can help.

thanks

Excel_ent1
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
34,030
Office Version
365
Platform
Windows
Hi & welcome to MrExcel
How about
Code:
Sub Excel_ent1()
   Dim Cl As Range
   For Each Cl In Range("G1", Range("G" & Rows.count).End(xlUp))
      If Cl <> "" Then Cl.EntireRow.Name = Cl
   Next Cl
End Sub
This assumes all names are valid for a named range
 

Excel_ent1

New Member
Joined
Mar 6, 2019
Messages
2
FLuff - you my friend are a genius ! Works like a donkey in blackpool, in summer, at 2pm. LEGEND.

thanksyou for tkaing the time to help me out, means alot, saved me about 3 hours of manually naming stuff !!! then getting it wrong, then smashing my pc up. then going to poc world to be talked to by a complete "not not it all" salesman who would sell me an apple mac, then i would just retire fom life.

LEGEND !
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
34,030
Office Version
365
Platform
Windows
Glad to help & thanks for the feedback
 

Forum statistics

Threads
1,086,237
Messages
5,388,631
Members
402,127
Latest member
Jemx

Some videos you may like

This Week's Hot Topics

Top