Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine if column is within range of columns
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine if column is within range of columns
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine if column is within range of columns
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine if column is within range of columns
Bob,
I realised it was the wrong way round as soon as l sent it to you. However it was my mistake, l didn't put a space between NotIntersect! I'm being a real dimlo this morning. Many thanks for your help Michael "Bob Phillips" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Determine a result of one column based on conditions in two column | Excel Discussion (Misc queries) | |||
Determine last row in columns 1-4 to copy a formula in column 5 | Excel Programming | |||
print 3 column range in six columns | Excel Discussion (Misc queries) | |||
Referencing a Column in a Selected Range of Columns | Excel Programming | |||
Determine start column/ end column of Merged Cell | Excel Programming |