Sorry, Tom, that won't work properly, it will only delete every other row (try filling in 4000 rows from 1/1/2000 onwards to see). You need to go backwards with this sort of thing. Also, your message will pop up every time a row is deleted, unless you remove it from inside the loop.
Ooops, right about the type-mismatch error, try this instead: -
Public Sub DeleteRows()
Dim rw As Integer
Dim x As Integer
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
rw = Range("C65536").End(xlUp).Row
For x = rw To 3 Step -1
If IsDate(Range("c" & x).Value) Then
If DateDiff("d", Range("c" & x).Value, Now) >= 120 And Range("c" & x).Value<> "" _
Then Rows(x).EntireRow.Delete shift:=xlUp
End If
Next x
.ScreenUpdating = True
.Calculation = xlCalculationAutomatic
End With
End Sub
This message was edited by Mudface on 2002-03-22 13:41