Compare and delete row

I

intheway

I need some help - I need to compare a cell, let's say A1, that wil
contain a date. I need Excel to compare it to today's date, if it i
over 60 days, I need it to go ahead and delete that row. If not, I nee
it to leave alone.

Thanks in advanc
 
R

Ron de Bruin

Try this

Sub test()
If IsDate(Range("a1")) = True Then
If Range("a1").Value > Date + 60 Then Range("a1").EntireRow.Delete
End If
End Sub
 
A

avivit

How can I compare 2 columns content,
and in 3rd column, to get a text "different content" where different o
something like that.

Thank
 
D

dallas

Hi intheway

if you mean older than 60 days...

Sub test()
If IsDate(Range("a1")) = True Then
If Range("a1").Value < Date - 60 Then Range("a1").EntireRow.Delete
End If
End Sub


dalla
 
Top