Range Minus operator?

  • Thread starter Thread starter Zbigniew Malinowski
  • Start date Start date
Z

Zbigniew Malinowski

Hi,

I'm working on an Excel 2000 application. It could be very useful if I could
use something like MINUS operator for Range objects.

Ex. I can do INTERSECT to find a common Range. I can use UNION to find a sum
of Ranges. But can I find a part of a Range that is not included in another
Range object?

I'm surprized but I'm unable to find something like this.

Any help apprectiated

Zbig
 
Here is a function that works okay from VBA returning a range object

'-----------------------------------------------------------------
Function AntiUnion(SetRange As Range, UsedRange As Range) As Range
'-----------------------------------------------------------------
Dim saveSet
saveSet = SetRange.Formula
SetRange.ClearContents
UsedRange = 0
Set AntiUnion = SetRange.SpecialCells(xlCellTypeBlanks)
SetRange = saveSet
End Function


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top