PC Review


Reply
Thread Tools Rate Thread

Creating a truncated range- Speed issue

 
 
avi
Guest
Posts: n/a
 
      2nd Feb 2008
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
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      2nd Feb 2008
Maybe you could apply data|filter|autofilter and filter to show only the values
>= filterminvalue. Then you could use specialcells(xlcelltypevisible) to get the range???


avi wrote:
>
> 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


--

Dave Peterson
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Speed issue creating Excel spreadsheet Stephen Plotnick Microsoft VB .NET 8 5th Nov 2009 12:17 AM
creating a filtered range/named range mark kubicki Microsoft Excel Programming 1 4th Nov 2006 03:14 PM
Creating database result view in Frontpage, result is truncated at 256 - need to expand Beefminator Microsoft Frontpage 1 3rd Jun 2006 09:54 AM
Can I use named range in data range box when creating pie chart? =?Utf-8?B?QkphY2tzb24=?= Microsoft Excel Charting 2 17th Aug 2005 05:37 PM
Truncated name when creating new database =?Utf-8?B?RG9uIERhbGV5?= Microsoft Access VBA Modules 4 23rd Mar 2005 05:45 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:46 PM.