View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
kkknie[_89_] kkknie[_89_] is offline
external usenet poster
 
Posts: 1
Default Code works but I have to run it 4 times

The problem is that when you delete a row where there is another blan
in column D below it, the loop skips over the next row (since it ha
become the current row). Another way to handle this is to loop fro
the bottom like so:

Dim i As Long

For i = Range("D65536").End(xlUp).Row To 2 Step -1
If Range("D" & i).Value = "" Then Range("A" & i & ":D" & i).Delet
shift:=xlUp
Next

This should handle your specific issue.



--
Message posted from http://www.ExcelForum.com