Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default What range is a cell in?

Concerning Excel VBA: Does anyone know of a way that I can find ou
what range a particular cell (ActiveCell) is in? Here's th
situation: I have several named ranges in a worksheet. When a cel
changes, if it is in a particular range, then some code needs to b
executed, and, if it's in another range, other code needs to b
executed

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default What range is a cell in?

Ye, Bob Phillips does

http://www.google.com/groups?selm=Ov...GP11.phx.gb l

ppsza wrote:

Concerning Excel VBA: Does anyone know of a way that I can find out
what range a particular cell (ActiveCell) is in? Here's the
situation: I have several named ranges in a worksheet. When a cell
changes, if it is in a particular range, then some code needs to be
executed, and, if it's in another range, other code needs to be
executed.

Thanks!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default What range is a cell in?

I looked at the link:

If Intersect(Activecell,Range("Name1") Then
'do something
ElseIf Intersect(Activecell,Range("Name2") Then
'do something else
etc.

Is it possible to replace the 'Range("Name1")' Range
("a1:10")' or suchlike?


-----Original Message-----
Ye, Bob Phillips does

http://www.google.com/groups?selm=OvDsp5TMEHA.2284%

40TK2MSFTNGP11.phx.gbl

ppsza wrote:

Concerning Excel VBA: Does anyone know of a way that I

can find out
what range a particular cell (ActiveCell) is in? Here's

the
situation: I have several named ranges in a worksheet.

When a cell
changes, if it is in a particular range, then some code

needs to be
executed, and, if it's in another range, other code

needs to be
executed.

Thanks!


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default What range is a cell in?

Dennis,

Indeed it is. The previous poster ws using named ranges, that is why we used
that syntax. The other post is not absolutely correct, this is (I hope)

If Not Intersect(ActiveCell, Range("A1:A10")) Is Nothing Then
'do something
ElseIf Not Intersect(ActiveCell, Range("B1:B10")) Is Nothing Then
'do something else
etc.

It works in the same way

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Dennis" wrote in message
...
I looked at the link:

If Intersect(Activecell,Range("Name1") Then
'do something
ElseIf Intersect(Activecell,Range("Name2") Then
'do something else
etc.

Is it possible to replace the 'Range("Name1")' Range
("a1:10")' or suchlike?


-----Original Message-----
Ye, Bob Phillips does

http://www.google.com/groups?selm=OvDsp5TMEHA.2284%

40TK2MSFTNGP11.phx.gbl

ppsza wrote:

Concerning Excel VBA: Does anyone know of a way that I

can find out
what range a particular cell (ActiveCell) is in? Here's

the
situation: I have several named ranges in a worksheet.

When a cell
changes, if it is in a particular range, then some code

needs to be
executed, and, if it's in another range, other code

needs to be
executed.

Thanks!


.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default What range is a cell in?

It actually has an error, it should be

If Not Intersect(ActiveCell, Range("Name1")) Is Nothing Then
'do something
ElseIf Not Intersect(ActiveCell, Range("Name2")) Is Nothing Then
'do something else
etc.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Steve Garman" wrote in message
...
Ye, Bob Phillips does

http://www.google.com/groups?selm=Ov...GP11.phx.gb l

ppsza wrote:

Concerning Excel VBA: Does anyone know of a way that I can find out
what range a particular cell (ActiveCell) is in? Here's the
situation: I have several named ranges in a worksheet. When a cell
changes, if it is in a particular range, then some code needs to be
executed, and, if it's in another range, other code needs to be
executed.

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
Find Last cell in Range when range is date format default105 Excel Discussion (Misc queries) 5 July 7th 09 03:11 PM
RANGE EXCEL copy cell that meets criteria in a range confused Excel Worksheet Functions 3 March 27th 08 01:41 PM
copy range and paste into every 3rd cell of new range thomsonpa New Users to Excel 4 December 3rd 07 01:47 PM
Referencing a named range based upon Range name entry in cell Barb Reinhardt Excel Worksheet Functions 14 June 20th 07 07:19 PM
Selecting range in list of range names depending on a cell informa Courreges Excel Discussion (Misc queries) 2 June 19th 06 10:59 AM


All times are GMT +1. The time now is 06:20 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"