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
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
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
 
Upvote 0
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 !
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top