View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
marcus[_3_] marcus[_3_] is offline
external usenet poster
 
Posts: 140
Default For/Next Is Not Looping - Only Deletes First Instance

Hi Safari

Starting at the bottom and moving backwards will help. Something like
this should do the trick.

Take Care

Marcus

Sub DelGreaterThan()

Dim i As Integer
Dim CompDate As Date
CompDate = Range("A1").Value

For i = 500 To 5 Step -1
If Range("A" & i).Value CompDate Then
Range("A" & i).EntireRow.Delete
End If
Next i

End Sub