View Single Post
  #21   Report Post  
Posted to microsoft.public.excel.programming
jim.wilcox jim.wilcox is offline
external usenet poster
 
Posts: 5
Default algorithm to INVERT a multiarea selection ?

Have I missed something?

Yes.

Function NotIntersect(rng As Range, x As Range) As Range

rng is the source
x is the range to be removed from the source

I presented the function in such a way that x should be a single-area
range, because calling the function within a loop...

for each x in bigx.Areas
NotIntersect(Selection, x).Select

....or whatever, would be a trivial exercise for the reader, and would
detract from understanding the basic and very simple concept of what my
code achieves, extremely efficiently.

-Jim