View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Activecell - Probably very easy question

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 = Target.Parent then
if not intersect(rng, target) is nothing then
msgbox "Member of " & nm & ", " & 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

--
Regards,
Tom Ogilvy


"MattShoreson"
wrote in message
news:MattShoreson.1q9eui_1118153134.0004@excelforu m-nospam.com...

I have a Worksheet_Change event.

In vba how can I find out the name of the range the changed cell is
in?

For the life of me I cant work out how to get it!


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile:

http://www.excelforum.com/member.php...fo&userid=3472
View this thread: http://www.excelforum.com/showthread...hreadid=377047