Hi i have this code but i get the error:

Run-time error '1004'
auto filter method of range class failed.

Im not too familiar with VB so im not sure how to fix this, anyone have any ideas thanks?

Sub Delete_Rows_Col6()

   
    Dim wks As Worksheet
    
    For Each wks In ActiveWorkbook.Worksheets
        wks.Select
        
    ' Clears contents of selected range
    ActiveSheet.Range("A13:A3000").ClearContents
    
    
    'Delete cells
    Selection.AutoFilter Field:=16, Criteria1:="="
    Rows("13:129").Select
    Application.CutCopyMode = False
    Selection.Delete Shift:=xlUp
    Selection.AutoFilter Field:=16
    Range("A5").Select
    
    Selection.AutoFilter Field:=6, Criteria1:="<00:05:00", Operator:=xlAnd
    Rows("13:286").Select
    Selection.Delete Shift:=xlUp
    ActiveWindow.SmallScroll Down:=-12
    Range("D24").Select
    Selection.AutoFilter Field:=6
        
    Next wks

    Sheets("Main").Select
    Range("A1").Select
    MsgBox "Duplicates Deleted, Job Complete"

End Sub