I found this code online and apparently it works for other people but not me? I don't know where it's wrong. I made a simple example and have my Range1 and Range 2 to be certain cells in excel, 
Also, I would like to know if there is a way to return the intersections, if it can. Thanks in advance!
Function InRange(Range1 As Range, Range2 As Range) As Boolean
Set intersectRange = Application.Intersect(Range1, Range2)
If intersectRange Is Nothing Then
InRange = False
Else
InRange = True
End If
End Function
It seems to me that you are expecting Intersect to check whether the two ranges have cells with the same values? Is that the point from having the value "a" in both S15 and T15?
If so, then this is why you are not getting what you expect. The Intersect function returns a range that is the "overlap" of the two ranges, regardless of the values inside each.
As this is my first post on SE, I hope this helps :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With