Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Determing range name that is tied to the active cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Determing range name that is tied to the active cell


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Determing range name that is tied to the active cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Determing range name that is tied to the active cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Determing range name that is tied to the active cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Determing range name that is tied to the active cell

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sum Every 4th column in a range tied to a control cell [email protected] Excel Worksheet Functions 4 August 19th 08 03:41 PM
Clearly seeing active cell in a range dsa Excel Discussion (Misc queries) 2 March 24th 08 03:22 PM
Determing Range Criteria Jim Aksel Excel Worksheet Functions 11 September 18th 07 09:34 PM
Active cell as range Patrick Simonds Excel Programming 4 May 29th 06 08:21 PM
Determing a range from numerical data Moises Excel Programming 2 July 19th 05 06:30 PM


All times are GMT +1. The time now is 09:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"