Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have quite a few defined range names in an active worksheet. Can I
get the defined NAME of of the range that the activecell resides ( In VBA of course). |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Adapted from a post by Tom Ogilvy:
Sub nm() Dim nm As Name, rng As Range For Each nm In ThisWorkbook.Names On Error Resume Next Set rng = nm.RefersToRange On Error GoTo 0 If Not rng Is Nothing Then If rng.Parent.Name = ActiveSheet.Name Then If Not Intersect(rng, ActiveCell) Is Nothing Then MsgBox "Member of " & nm.Name & ", " & _ rng.Address(external:=True) ' either use "exit for" or continue to loop to see ' if it is in more than one named range End If End If End If Next End Sub Hope this helps Rowan "Arishy" wrote: I have quite a few defined range names in an active worksheet. Can I get the defined NAME of of the range that the activecell resides ( In VBA of course). |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thank you Rowan...and of course Our very dear Tom... It worked like a charm. *** Sent via Developersdex http://www.developersdex.com *** |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You're welcome.
"Samir Arishy" wrote: Thank you Rowan...and of course Our very dear Tom... It worked like a charm. *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Row select mode to highlight active row of active cell | Excel Discussion (Misc queries) | |||
Run-time error '50290': Application-defined or object-defined erro | Excel Discussion (Misc queries) | |||
referring to formula in a non active cell from active cell | Excel Discussion (Misc queries) | |||
Application-Defined or Object-Defined Error on simple code | Excel Programming | |||
How to count rows in a user-defined AutoFilter or AdvancedFilter is active? | Excel Programming |