Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Cell in Range Testing Function

Can anyone point me to a function that will return a value base on
whether a range of cells is;
1. Located inside another specified range.
2. Intersects another specified Range.
3. Does not intersect another specified range

The function I am looking for would include the ranges in the call
arguments. If I could be so bold I would prefer that this function
support multiple areas as well ( Oh yea, now I'm asking for it.)

I could code this myself, but like the rest of us I'm lazy.

Thanks everyone,

Jim C.


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Cell in Range Testing Function

The Intersect Method does this:

Sub isect()
Dim rng1 As Range
Dim rng2 As Range
Set rng1 = Range("A1:D2")
Set rng2 = Range("D3")
If Not Application.Intersect(rng1, rng2) Is Nothing Then
'They intersect
MsgBox rng1.Address & " intersects " & rng2.Address
Else
MsgBox rng1.Address & " does not intersect " & rng2.Address
End If
End Sub

This works with contiguous or non-contiguous ranges.

Hth,
Tim

"Jim C." wrote in message
...
Can anyone point me to a function that will return a value base on
whether a range of cells is;
1. Located inside another specified range.
2. Intersects another specified Range.
3. Does not intersect another specified range

The function I am looking for would include the ranges in the call
arguments. If I could be so bold I would prefer that this function
support multiple areas as well ( Oh yea, now I'm asking for it.)

I could code this myself, but like the rest of us I'm lazy.

Thanks everyone,

Jim C.


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Cell in Range Testing Function

You are most welcome. Glad to help.
Tim

"Jim C." wrote in message
...
Tim:

Haven't had a chance to try this solution out, but it looks quite
eloquent.

Thanks for saving me a great deal of difficult coding time, I was
going to choose another more arduous route.

I knew someone out there would know what I'm doing. Thanks again for
such a tidy solution.

Jim C.

On Wed, 23 Jul 2003 10:42:56 -0700, "Tim Zych"
You said:

The Intersect Method does this:

Sub isect()
Dim rng1 As Range
Dim rng2 As Range
Set rng1 = Range("A1:D2")
Set rng2 = Range("D3")
If Not Application.Intersect(rng1, rng2) Is Nothing Then
'They intersect
MsgBox rng1.Address & " intersects " & rng2.Address
Else
MsgBox rng1.Address & " does not intersect " & rng2.Address
End If
End Sub

This works with contiguous or non-contiguous ranges.

Hth,
Tim

"Jim C." wrote in message
.. .
Can anyone point me to a function that will return a value base on
whether a range of cells is;
1. Located inside another specified range.
2. Intersects another specified Range.
3. Does not intersect another specified range

The function I am looking for would include the ranges in the call
arguments. If I could be so bold I would prefer that this function
support multiple areas as well ( Oh yea, now I'm asking for it.)

I could code this myself, but like the rest of us I'm lazy.

Thanks everyone,

Jim C.


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via

Encryption
=---




Regards,

Jim C.
Using MS Office 97


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet

News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000

Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---




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
Testing selection against named range [email protected][_2_] Excel Discussion (Misc queries) 5 April 17th 12 04:19 PM
testing range of cells for part of cell content Daniel Excel Worksheet Functions 5 March 25th 10 08:14 PM
TESTING A RANGE OF CELLS Richard[_2_] New Users to Excel 3 April 1st 07 02:52 PM
TESTING A RANGE OF CELLS Richard[_2_] Excel Worksheet Functions 3 April 1st 07 02:52 PM
Testing a person's age to be within a range MH Excel Worksheet Functions 10 December 31st 06 10:04 PM


All times are GMT +1. The time now is 11:54 AM.

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"