View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default faster method to delete rows

Hi Jake

You can filter or use union
http://www.rondebruin.nl/delete.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Jake" wrote in message ...
I'm using this code to delete unwanted rows, testing column A and leaving
values between 1 and 12, in a database:
LastRow = wksSheet.Cells(Rows.Count, "A").End(xlUp).Row
For x = LastRow To 2 Step -1
' If .Cells(x, 1).Value < 1 Or .Cells(x, 1) 12 Then .Cells(x,
1).EntireRow.Delete
' Next x

it's effective, but takes a lot of time.
Is there a faster method for this?
thanks,
Jake


__________ Information from ESET Smart Security, version of virus signature database 3943 (20090317) __________

The message was checked by ESET Smart Security.

http://www.eset.com




__________ Information from ESET Smart Security, version of virus signature database 3943 (20090317) __________

The message was checked by ESET Smart Security.

http://www.eset.com