Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have no problem in addressing cells with name, adding names to the list but
have not yet found the way to retreive the name of the active cells. If any one has a clue, this would be very appriciated. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
A named cell is a range object with a string name, so:
Sub Nms() Range("A1").Name = "NamedCell" Range("NamedCell").Value = Range("A1").Value MsgBox Range("NamedCell").Address End Sub "Xavier" wrote: I have no problem in addressing cells with name, adding names to the list but have not yet found the way to retreive the name of the active cells. If any one has a clue, this would be very appriciated. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It's awkward because there is no Names collection for the Range object. Also,
a range can have more than one name assigned to it. The following code displays every name assigned to the active cell only: Sub AAAAA() Dim x As Long For x = 1 To ActiveWorkbook.Names.Count If Range(ActiveWorkbook.Names(x)).Address = _ ActiveCell.Address Then MsgBox ActiveWorkbook.Names(x).Name End If Next x End Sub Hope this helps, Hutch "Xavier" wrote: I have no problem in addressing cells with name, adding names to the list but have not yet found the way to retreive the name of the active cells. If any one has a clue, this would be very appriciated. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, I missed the key question. Here, look at Nm:
Sub Nms() Range("A1").Name = "NamedCell" Range("NamedCell").Value = Range("A1").Value MsgBox Range("NamedCell").Address Nm = ActiveCell.Name.Name MsgBox Nm End Sub "Xavier" wrote: I have no problem in addressing cells with name, adding names to the list but have not yet found the way to retreive the name of the active cells. If any one has a clue, this would be very appriciated. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I name cell E2 "MyCell", the following code returns the name:
Range("E2").Name.name This only works if it is a single cell named range. --JP On Aug 13, 12:35*pm, Xavier wrote: I have no problem in addressing cells with name, adding names to the list but have not yet found the way to retreive the name of the active cells. If any one has a clue, this would be very appriciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Retreive part of the value from each cell - Macor and/or forumula | Excel Discussion (Misc queries) | |||
Macro affecting hyperion retreive | Excel Programming | |||
VBA Excel Macro to delete contents in named cell | Excel Discussion (Misc queries) | |||
Macro Using Named Cell | Excel Programming | |||
Macro Using Named Cell | Excel Programming |