ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Creating cell names from cell contents en masse (https://www.excelbanter.com/excel-worksheet-functions/230906-creating-cell-names-cell-contents-en-masse.html)

John[_26_]

Creating cell names from cell contents en masse
 
I'm attempting to apply unique cell names for 30,000 individual cells.
The cell names are easily propogated in cells, but I'm stuck on how to
efficiently transfer this info to the cell names. I've searched the
archives but haven't had any luck finding a shortcut! Help!

Simon Lloyd[_236_]

Creating cell names from cell contents en masse
 

John;346074 Wrote:
I'm attempting to apply unique cell names for 30,000 individual cells.
The cell names are easily propogated in cells, but I'm stuck on how to
efficiently transfer this info to the cell names. I've searched the
archives but haven't had any luck finding a shortcut! Help!If you really want to name 30,000 cells and heaven knows why you would!

you can use this code, this assumes the cells all have entries that will
be their individual name and that there aren't any duplicates:

Code:
--------------------
Sub NameCells()
Dim cell As Range
For Each cell In Range("A1:A100")
cell.Name = cell.Value
Next cell
End With
End Sub
--------------------


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=96824



All times are GMT +1. The time now is 08:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com