I have two questions: 1) How do I check if the intersection or a range is not empty? For example if I want to check if its empty I write for example
if application.intersect(r1,r2) is nothing
but is there something that is negation of nothing? not nothing didn't work for example.
2) How can I compate ranges? For example I have ranges r1,r2,r3 and I want to check if the intersection of r1 and r2 is r3. Two thing that I have tried and didn't work:
1 - application.intersect(r1,r2) = r3
2 - application.intersect(r1,r2) is r3
Would appreciate any help that I can get, Thanks!
To see if the intersection of two ranges is a third range:
Set intRng = Intersect(R1, R2)
If Not intRng Is Nothing then
Set intRng = Intersect(intRng, R3)
If Not Intersect(intRng) Is Nothing
If intRng.Address = R3.Address Then MsgBox "intersection of ranges R1 and R2 is range R3"
End If
End If
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