Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Programmatically, I'd like to be able to determine the range name that is
tied to the active cell. How would I do that? Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() sub cellname() msgbox active.cell.name end sub -- Don Guillett SalesAid Software "Barb Reinhardt" wrote in message ... Programmatically, I'd like to be able to determine the range name that is tied to the active cell. How would I do that? Thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub demp2()
Dim n As Name For Each n In ActiveWorkbook.Names If Intersect(ActiveCell, Range(n.Name)) Is Nothing Then Else MsgBox (n.Name) End If Next End Sub -- Gary''s Student "Barb Reinhardt" wrote: Programmatically, I'd like to be able to determine the range name that is tied to the active cell. How would I do that? Thanks |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Barbara,
Try: '============= Public Sub Tester() Dim sStr As String On Error Resume Next sStr = Range("A1").Name.Name If Err.Number = 0 Then MsgBox sStr End If On Error GoTo 0 End Sub '<<============= --- Regards, Norman "Barb Reinhardt" wrote in message ... Programmatically, I'd like to be able to determine the range name that is tied to the active cell. How would I do that? Thanks |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Norm:
What happens if there are several Named Ranges that include cell A1? -- Gary's Student "Norman Jones" wrote: Hi Barbara, Try: '============= Public Sub Tester() Dim sStr As String On Error Resume Next sStr = Range("A1").Name.Name If Err.Number = 0 Then MsgBox sStr End If On Error GoTo 0 End Sub '<<============= --- Regards, Norman "Barb Reinhardt" wrote in message ... Programmatically, I'd like to be able to determine the range name that is tied to the active cell. How would I do that? Thanks |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Gary,
What happens if there are several Named Ranges that include cell A1? The first name (alphabetically) wpould be returned. To return possible multiple names, it would be necessary to loop, as suggested by you, and test that the name range and the cell/range were identical. --- Regards, Norman "Gary''s Student" wrote in message ... Hi Norm: What happens if there are several Named Ranges that include cell A1? -- Gary's Student "Norman Jones" wrote: Hi Barbara, Try: '============= Public Sub Tester() Dim sStr As String On Error Resume Next sStr = Range("A1").Name.Name If Err.Number = 0 Then MsgBox sStr End If On Error GoTo 0 End Sub '<<============= --- Regards, Norman "Barb Reinhardt" wrote in message ... Programmatically, I'd like to be able to determine the range name that is tied to the active cell. How would I do that? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sum Every 4th column in a range tied to a control cell | Excel Worksheet Functions | |||
Clearly seeing active cell in a range | Excel Discussion (Misc queries) | |||
Determing Range Criteria | Excel Worksheet Functions | |||
Active cell as range | Excel Programming | |||
Determing a range from numerical data | Excel Programming |