Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Activecell - Probably very easy question


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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



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
ActiveCell.Offset Question ash3154 New Users to Excel 5 September 12th 09 01:46 PM
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
Easy question M&M[_2_] Excel Discussion (Misc queries) 3 August 11th 07 07:00 AM
new user with easy question? not easy for me speakeztruth New Users to Excel 5 June 3rd 05 09:40 PM
ActiveCell.Top question Brad K. Excel Programming 1 March 14th 05 03:29 AM


All times are GMT +1. The time now is 10:44 AM.

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

About Us

"It's about Microsoft Excel"