View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dion Dion is offline
external usenet poster
 
Posts: 12
Default slow code needs tuning

Try:
Application.ScreenUpdating = False
with range("Field1")
for each cl in .cells
if cl = "" then cl.entirerow.delete
next
end with
Application.ScreenUpdating = True





"David" wrote:

Greetings and TIA for your time
I have a database of about 2,500 records.
I am deleting all records that have a null string (="") in field1:

with range("Field1")
for each cl in .cells
if cl = "" then cl.entirerow.delete
next
end with

This works fine but is slow.

if the cells i were looking for contained blanks, I could use:
range("Field1").specialcells(xlblanks).entirerow.d elete
which I think would be much quicker. sadly, I'm hunting for null strngs.
Any ideas on how to speed the code up?
--
David