Excel macro help needed to name ranges

Solved/Closed
Galah - Aug 30, 2008 at 09:57 PM
 ... - Mar 23, 2012 at 01:07 AM
Hello,

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.

Galah
Related:

4 responses

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 :-)

Cheers,
Galah
3
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
2
Thanks for sharing. Its working perfectly
0
trance3223 Posts 17 Registration date Monday August 11, 2008 Status Member Last seen November 21, 2008 8
Aug 31, 2008 at 10:06 AM
have you checked if there isnt any details in the help file of excel itself?

you can have something there
-1
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.
-1