View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
John[_19_] John[_19_] is offline
external usenet poster
 
Posts: 87
Default what wrong here, range Cell as counter

In the range, MYRange I want each cell to have it's own little subrange
to search. I try and do it below.

When it gets to Subrange(cell)= it uses the value of cell instead of
cell as a range and delivers an out of range error (or identifies the
incorrect range using the Cell value).

Thanks

John

-------------------------
Dim Cell as Range

Dim Myrange as range, Anotherrange as Range etc.

Set Myrange=(whatever))
Set Anotherrange= a range with offsets of cell
etc.
Dim Subrange(100) as Range

For Each Cell in MyRange
Subrange(Cell)=Union(AnotherRange, YetAnotherrange, AndAnotherrange)
Next