Excel macro help needed to name ranges

 ... -

I have a 10 column x 500 row spreadsheet A1:J500

I would like to name ranges as follows:
Range A1:J1 should be named with the content of cell A1, range A2:J2 should be named with the content of cell A2, etc, etc.

Can anyone help me with a macro that will do this for the 500 rows, please?

I'm using Excel 2000 and 2003.

Many thanks in advance.


4 replies

Hi Trance3223,

Thank you for your reply. The first place I looked was the Excel help file, but could not find an answer to my problem there. Or on any of the Microsoft websites.

Which is why I asked the experts here :-)

Range("A1:J1").Name = Range(A1").value - assuming it's a string value

that's it - so range A1:J1 will be named/labeled by the content in A1
Thanks for sharing. Its working perfectly
Registration date
Monday August 11, 2008
Last seen
November 21, 2008
have you checked if there isnt any details in the help file of excel itself?

you can have something there
Highlight or select the range of cells. Ctrl+Shift+F3 Select the top, left, bottom, right most column, or row to use to Name your selected range. This does not work on one cell. You can however, right click from your active cell, select "Name a range", and type in the name. This works for a single or range of cells.