Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find Last cell in Range when range is date format | Excel Discussion (Misc queries) | |||
RANGE EXCEL copy cell that meets criteria in a range | Excel Worksheet Functions | |||
copy range and paste into every 3rd cell of new range | New Users to Excel | |||
Referencing a named range based upon Range name entry in cell | Excel Worksheet Functions | |||
Selecting range in list of range names depending on a cell informa | Excel Discussion (Misc queries) |