Hi All

My Macro stopped working in Excel 2010 but is ok in Excel 2019.

Sub xlDelDP()
Dim ws As Worksheet, cell As Range, rng As Range
Set ws = ThisWorkbook.Sheets("Offences")
lrow = ws.Range("A" & Rows.Count).End(xlUp).Row
Set rng = Sheets("Offences").Range("A2:A" & lrow)
For i = lrow To 2 Step -1
Set cell = ws.Range("A" & i)
If CDate(cell) <= Date - 365 Then cell.EntireRow.Delete
Next
Sheets("Front").Activate
End Sub

Its purpose is to delete data older than 12 months for Data Protection purposes.

Any help gratefully received.