View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default help! how to delete useless rows in 2 dim array by VBA

Putting information in an array won't provide any gain if you are still
deleting rows in the worksheet.

You can filter so that the rows to delete are visible then

Dim rng as Range
set rng = activesheet.AutofilterRange.Columns(1)
set rng = rng.offset(1,0).Resize(rng.rows.count-1)
On Error Resume Next
set rng1 = rng.specialcells(xlvisible)
On Error goto 0
if not rng1 is nothing then rng1.EntireRow.delete

--
Regards,
Tom Ogilvy

"xiang" wrote in
message ...

I just would like to fulfill autofilter function in a 2-dim array, and
then delete
useless rows in that array. Is that doable or not?

as you know, deleting rows is so painful in worksheet even though
autofilter
is faster.

any idea or example would be much appreciated.

thanks


--
xiang
------------------------------------------------------------------------
xiang's Profile:

http://www.excelforum.com/member.php...o&userid=29489
View this thread: http://www.excelforum.com/showthread...hreadid=496567