Thread: =now() -30 days
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_7_] Bob Phillips[_7_] is offline
external usenet poster
 
Posts: 1,120
Default =now() -30 days

How strange!

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Target.Column = 3 Then
If Target.Value < Date - 30 Then
Target.EntireRow.Delete
End If
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--
HTH

Bob Phillips

"Steve" wrote in message
...
I would like to set up my worksheet so that if the date in column C is

more
than 30 day ago, that entire row will be deleted. Can anyone help?

Thanks,
Steve