View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default Dealing with Ranges

Hi
1. for adding/combining ranges have a look at the Union method in vBA
dim rng as range
set rng=union(range1,range2)

2. For checking if they overlap use Intersect


--
Regards
Frank Kabel
Frankfurt, Germany

"Dean Goodmen" schrieb im Newsbeitrag
...
I looked in the excel help files but could not seem to find an
examples on Ranges and adding and removing ranges
from it. I was hoping someone here could someone make up a short
example for me.

1 I need a Ranged created that I can Add and Remove cells from
within any sub in my workbook.
2 Sample line to Add and remove a cell range. (Example :
TotalRange = TotalRange - My range)
3 Sample line to check if a range is contained in the range(
Example : Is MyRange in TotalRange.)

Thanks in advance :