How to Insert a Cell Name into the Cell

I have a large excel workbook (in Excel 2010) with more than 6,000 named cells. I would like to write a function that sets the cell value equal to the cell name.

I thought the following would work:

Sub FillNamedCells()
On Error Resume Next
For Each c In ActiveWorkbook.Names
Range(c).Value = Range(c).Name
Next
End Sub

Unfortunately this is returning the cell address though. I can't seem to figure out how to get it to return the cell name. I'm wondering if I need to change a setting. Can someone help me out with this?

Thanks!

Nick's picture

Range(c).Value = c.Name

Range(c).Value = c.Name

So Simple! Thanks it worked

So Simple! Thanks it worked like a charm.

It's the same thing as a

It's the same thing as a named range (you create it the same way) only each cell as its own unique name.

No, I have the syntax for listing all the named cells and their address. In this case I just want to put the name of each cell in the cell.

It's the same thing as a

It's the same thing as a named range (you create it the same way) only each cell as its own unique name.

No, I have the syntax for listing all the named cells and their address. In this case I just want to put the name of each cell in the cell.

What do you mean by named

What do you mean by named cells? Is it the named range? Do you want to list all the named range in your workbook in a single sheet?