View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Determine if column is within range of columns

Hi Michael,

No the other way around

If Not Intersect(activecell,range("F:CZ")) Is Nothing Then
Code to do something

because the Intersect will return Nothing if they don't (intersect that is),
so Intersect(...) Is Nothing checks if they don't intersect, the Not checks
the negative of that (i.e if they DO intersect).

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Michael Beckinsale" wrote in message
...
Bob,

Sorry l must have my "dense" head on this morning!

How do l use this code? somrthing like this ?

If Not Intersect(activecell,range("F:CZ")) Is Nothing Then
Exit sub
Else
Code to do something

Regards

Michael

"Bob Phillips" wrote in message
...
Not Intersect(activecell,range("F:CZ")) Is Nothing

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Michael Beckinsale" wrote in message
...
Hi All,

Does anybody have the code to determine if the ActiveCell is within a

range
of columns ie F:CZ ?

I think l should be able to use the Intersect function if l state the
full
range (ie F6:CZ5006) but have had no luck so far.

For various reasons l cannot restrict the selection of cells by locking

and
using = xlUnlockedCellsOnly using the worksheet activate event.

All help / suggestions gratefully received

Regards

Michael Beckinsale