View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
avi avi is offline
external usenet poster
 
Posts: 195
Default Creating a truncated range- Speed issue

Hello,

I try to create a truncated range: the new range shoulsd contain only
values greater than FilterMinValue

The following code does the job but is quite slow. Is there some
fastest way to get the new range?

For Each cell In RangeAddress
If cell.Value = FilterMinValue Then
If rng Is Nothing Then
'initialize rng with first found cell
Set rng = cell
Else
'expand the found range variable
Set rng = xlApp.Union(rng, cell)
End If
End If
Next cell

Thanks a lot
Avi