ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SelectionChange works only when Cellpointer is within a given rang (https://www.excelbanter.com/excel-programming/378026-selectionchange-works-only-when-cellpointer-within-given-rang.html)

John

SelectionChange works only when Cellpointer is within a given rang
 
Hi,

I only want the SelectionChange event to run if the Cellpointer is within
the range B5:G11, or probaby better referring to B5:G11 as a Range name

EG If Target.Address is within the range B5:G11 then run the SelectionChange
event!

Hope that makes sense to someone.

Thanks

John



Jim Thomlinson

SelectionChange works only when Cellpointer is within a given rang
 
You can use the intersect method something like this...

if not intersect(target, Range("B5:G11")) is nothing then
msgbox "Bombs Away..."
end if
--
HTH...

Jim Thomlinson


"John" wrote:

Hi,

I only want the SelectionChange event to run if the Cellpointer is within
the range B5:G11, or probaby better referring to B5:G11 as a Range name

EG If Target.Address is within the range B5:G11 then run the SelectionChange
event!

Hope that makes sense to someone.

Thanks

John



John

SelectionChange works only when Cellpointer is within a given
 
Cool, thanks Jim.

"Jim Thomlinson" wrote:

You can use the intersect method something like this...

if not intersect(target, Range("B5:G11")) is nothing then
msgbox "Bombs Away..."
end if
--
HTH...

Jim Thomlinson


"John" wrote:

Hi,

I only want the SelectionChange event to run if the Cellpointer is within
the range B5:G11, or probaby better referring to B5:G11 as a Range name

EG If Target.Address is within the range B5:G11 then run the SelectionChange
event!

Hope that makes sense to someone.

Thanks

John




All times are GMT +1. The time now is 02:03 PM.

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