What range is a cell in?

P

ppsza

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

Thanks
 
B

Bob Phillips

If Intersect(Activecell,Range("Name1") Then
'do something
ElseIf Intersect(Activecell,Range("Name2") 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)
 
Top