Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Test to see if a cell is within a range

What is the best way to define a range and then use it to test to see if a
cell is within that range? Something like ...

dim rngMine as range
set rngMine = range("$D$3", "$D$4", "$E$3:$F$41")
If activecell.address in rngMine then ...


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Test to see if a cell is within a range

Hi
have a look at intersect for this

--
Regards
Frank Kabel
Frankfurt, Germany

"Tim Coddington" schrieb im Newsbeitrag
...
What is the best way to define a range and then use it to test to see

if a
cell is within that range? Something like ...

dim rngMine as range
set rngMine = range("$D$3", "$D$4", "$E$3:$F$41")
If activecell.address in rngMine then ...



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Test to see if a cell is within a range

Tim ,

You won't be able to set the range like that

Dim rngMine As Range
Set rngMine = Range("$D$3, $D$4, $E$3:$F$41")
If Not Intersect(ActiveCell, rngMine) Is Nothing Then
MsgBox "found"
End If


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Tim Coddington" wrote in message
...
What is the best way to define a range and then use it to test to see if a
cell is within that range? Something like ...

dim rngMine as range
set rngMine = range("$D$3", "$D$4", "$E$3:$F$41")
If activecell.address in rngMine then ...




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Test to see if a cell is within a range - Thanks

Thanks for the help!
"Bob Phillips" wrote in message
...
Tim ,

You won't be able to set the range like that

Dim rngMine As Range
Set rngMine = Range("$D$3, $D$4, $E$3:$F$41")
If Not Intersect(ActiveCell, rngMine) Is Nothing Then
MsgBox "found"
End If


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Tim Coddington" wrote in message
...
What is the best way to define a range and then use it to test to see if

a
cell is within that range? Something like ...

dim rngMine as range
set rngMine = range("$D$3", "$D$4", "$E$3:$F$41")
If activecell.address in rngMine then ...






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Test if CELL is in RANGE Vaughan Excel Worksheet Functions 12 November 19th 06 03:48 PM
logical test for each and every cell in range matt Excel Discussion (Misc queries) 4 September 16th 05 06:11 AM
== How to test if a range var contains nothing hcova[_2_] Excel Programming 3 October 25th 04 10:08 PM
Test if Active Cell is in a named range Simon Shaw[_5_] Excel Programming 1 September 28th 04 12:11 AM
Test if Cell is within Range (name) goepf[_6_] Excel Programming 2 December 3rd 03 04:26 PM


All times are GMT +1. The time now is 06:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"