Creating a truncated range- Speed issue

  • Thread starter Thread starter avi
  • Start date Start date
A

avi

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
 
Maybe you could apply data|filter|autofilter and filter to show only the values
 
Back
Top