ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   identifying range (https://www.excelbanter.com/excel-programming/352489-identifying-range.html)

Yossi[_2_]

identifying range
 
Hi,
I want to check whether the ActiveCell is within a specific range. so when
using the Change function I would know whether to handle it or not.
How can I check if the target cell or the ActiveCell is within a certain
range?

Steve Yandl

identifying range
 
Use the Intersect function.

Steve



"Yossi" wrote in message
...
Hi,
I want to check whether the ActiveCell is within a specific range. so when
using the Change function I would know whether to handle it or not.
How can I check if the target cell or the ActiveCell is within a certain
range?




Dave Peterson

identifying range
 
This kind of thing checks for changes to exactly one cell in A1:B99.


If target.cells.count 1 then exit sub
if intersect(target,me.range("a1:B99")) is nothing then exit sub

'your code to do the work

Yossi wrote:

Hi,
I want to check whether the ActiveCell is within a specific range. so when
using the Change function I would know whether to handle it or not.
How can I check if the target cell or the ActiveCell is within a certain
range?


--

Dave Peterson


All times are GMT +1. The time now is 09:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com