View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 399
Default How to exclude certain cells from a range?

I have a range set to a group of cells (say A1:E5) -call it rngSquare. I've
iterated through this and picked out say 15 non-contiguous cells to create
another range - call it rngWork. Now let's throw in ranges for each row of
the square - rngRow1 - rngRow5.

I know I can intersect and union these ranges (such as: every cell in
rngRow1 that is also in rngWork) to narrow down a search-and-select mission.
But say I want to search every cell in rngWork **except** rngRow1. Do I
have to loop through all the ranges like:
Union(Intersect(rngWork, rngRow2), Intersect(rngWork, rngRow3), etc . . .
or is there an easier way to do something like:
Intersect(rngWork, Not rngRow1)???

Ed