View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Excel.Union returning two Areas

You have received good answers on Union. Perhaps what you want is this:

? Range(Range("$A$1:$M$88"),Range("$A$1:$Z$2")).Addr ess
$A$1:$Z$88

I believe this will give you the rectangle that can contain the two areas.
--
Regards,
Tom Ogilvy

"Daniel" wrote in message
om...
I am baffled, for some reason the following lines in the immidiate
window

? Excel.Union(Range("$A$1:$M$88"),Range("$A$1:$Z$2") ).AddressLocal

Outputs:

$A$1:$M$88,$A$1:$Z$2

Which is a Range with two Areas. I was expecting $A$1:$Z$88, which is
what I need. How would I make sure that Union only returns Ranges with
a single Area?

Thanks,
Daniel