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

i have a range (A1:C10) set to a variable "R" and i have a
cell set to a variable "C" (First E.I. B5, Second E.I. D5)

i need to know if C is within R

i have tried
Set NewC = Application.Intersect(R, C)

First E.I. it works good, no probs
But on the second E.I. NewC = nothing

Currently I have an error handler working with the cell
that is out side the range but their has to be a better
way to do this any ideas?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Finding if a cell is within a Range

You seem to have already worked out the key elements of the following approach:

If Intersect(R, C) Is Nothing Then
MsgBox "No intersect"
Else
MsgBox "Intersect"
End If

PS: What does E.I. signify?

--

John Green - Excel MVP
Sydney
Australia


" wrote in message ...
i have a range (A1:C10) set to a variable "R" and i have a
cell set to a variable "C" (First E.I. B5, Second E.I. D5)

i need to know if C is within R

i have tried
Set NewC = Application.Intersect(R, C)

First E.I. it works good, no probs
But on the second E.I. NewC = nothing

Currently I have an error handler working with the cell
that is out side the range but their has to be a better
way to do this any ideas?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default Finding if a cell is within a Range

thanks i was missing the is :)


-----Original Message-----
You seem to have already worked out the key elements of

the following approach:

If Intersect(R, C) Is Nothing Then
MsgBox "No intersect"
Else
MsgBox "Intersect"
End If

PS: What does E.I. signify?

--

John Green - Excel MVP
Sydney
Australia


"

wrote in message
...
i have a range (A1:C10) set to a variable "R" and i

have a
cell set to a variable "C" (First E.I. B5, Second E.I.

D5)

i need to know if C is within R

i have tried
Set NewC = Application.Intersect(R, C)

First E.I. it works good, no probs
But on the second E.I. NewC = nothing

Currently I have an error handler working with the cell
that is out side the range but their has to be a better
way to do this any ideas?



.

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
An old chestnut: finding the last cell in a range maninashed Excel Worksheet Functions 10 October 4th 09 05:13 PM
Finding the position of the i-th non blank cell in a vertical range vsoler Excel Worksheet Functions 6 September 11th 08 06:59 AM
Finding Cell Outside Of Range Minitman Excel Worksheet Functions 3 April 15th 08 06:34 AM
Finding max array value of variable cell range The Fisherman Excel Discussion (Misc queries) 0 February 6th 07 02:54 PM
Finding the bottom non-blank cell in a range Fenneth Excel Discussion (Misc queries) 7 July 6th 06 06:05 PM


All times are GMT +1. The time now is 06:18 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"