Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I get the name of a Cell
If a cell has already been named, how do I get that name returned in VBA? I
am trying to renanme each cell in a range that has already not been named. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I get the name of a Cell
Use the name.name property of the range, however you will get an error if
the range does not have a name, so use the the following to get the name for say range C3...... Sub RangeName() On Error Resume Next MsgBox Range("C3").Name.Name End Sub Chip Pearson has some more at http://www.cpearson.com/excel/named.htm -- Cheers Nigel "Delphin" wrote in message ... If a cell has already been named, how do I get that name returned in VBA? I am trying to renanme each cell in a range that has already not been named. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I get the name of a Cell
I do not understand. If the cell was still named C3, then it needs to be
changed. If it has been named CDU3 then skip it. How do I determine this. Here is my code so far: (which just stopped working...) For x = 1 To 20 Worksheets(1).Application.Cells(x, 1).Names = "ABE" & x Next x I have 2400 cells to name and really did not want to do this individually as there are maybe 100 that have already been named. This is becoming irritating. "Nigel" wrote: Use the name.name property of the range, however you will get an error if the range does not have a name, so use the the following to get the name for say range C3...... Sub RangeName() On Error Resume Next MsgBox Range("C3").Name.Name End Sub Chip Pearson has some more at http://www.cpearson.com/excel/named.htm -- Cheers Nigel "Delphin" wrote in message ... If a cell has already been named, how do I get that name returned in VBA? I am trying to renanme each cell in a range that has already not been named. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I get the name of a Cell
It is easier to just rename them rather than check if they have a name.
For x = 1 To 20 Worksheets(1)..Cells(x, 1).Name = "ABE" & x Next x You don't need application and Names should be singular. -- Regards, Tom Ogilvy "Delphin" wrote in message ... I do not understand. If the cell was still named C3, then it needs to be changed. If it has been named CDU3 then skip it. How do I determine this. Here is my code so far: (which just stopped working...) For x = 1 To 20 Worksheets(1).Application.Cells(x, 1).Names = "ABE" & x Next x I have 2400 cells to name and really did not want to do this individually as there are maybe 100 that have already been named. This is becoming irritating. "Nigel" wrote: Use the name.name property of the range, however you will get an error if the range does not have a name, so use the the following to get the name for say range C3...... Sub RangeName() On Error Resume Next MsgBox Range("C3").Name.Name End Sub Chip Pearson has some more at http://www.cpearson.com/excel/named.htm -- Cheers Nigel "Delphin" wrote in message ... If a cell has already been named, how do I get that name returned in VBA? I am trying to renanme each cell in a range that has already not been named. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options | Excel Discussion (Misc queries) | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing | Excel Discussion (Misc queries) | |||
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 | Excel Worksheet Functions | |||
How to create/run "cell A equals Cell B put Cell C info in Cell D | Excel Discussion (Misc queries) | |||
data validation to restrict input in cell based on value of cell above that cell | Excel Programming |