Re: delete rows on date
Put this in the ThisWorkbook module. Code will run when you open the workbook.
Code
Private Sub Workbook_Open()Dim lastRow As Long
Dim expDate As Date
Dim i As Long
Application.ScreenUpdating = False
'Change sheet name to suit
With Worksheets("Sheet1")
'Find last used row
lastRow = .Cells(.Rows.Count, "G").End(xlUp).Row
'Detemine date 6 months ago
expDate = WorksheetFunction.EDate(Date, -6)
For i = lastRow To 2 Step -1
'If date is older than expiration date...
If .Cells(i, "G").Value < expDate Then
'delete the row
.Rows(i).Delete
End If
Next i
End With
Application.ScreenUpdating = True
End Sub
Display More