Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jie,
You can use the Intersect method to test whether two ranges overlap. For example, Dim Range1 As Range Dim Range2 As Range Dim ISect As Range Set Range1 = Range("A1:C3") Set Range2 = Range("C1:C3") Set ISect = Application.Intersect(Range1, Range2) If ISect Is Nothing Then MsgBox "The ranges do not overlap at all" ElseIf ISect.Cells.Count = Range2.Cells.Count Then MsgBox "Range2 is completely contained within Range1" Else MsgBox "Range2 is partially contained within Range1" End If -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Jie" wrote in message ... Hi Is there a method in excel object model to easily find out if a range is a subset of another range and the start, end position of the subset? Thanks Jie |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
range names or check box | Excel Worksheet Functions | |||
check if value occurs within a range | Excel Worksheet Functions | |||
can a formula check for a certain value in a range? | Excel Discussion (Misc queries) | |||
check range for certain value | Excel Programming | |||
check if range containing values | Excel Programming |