Good day,

I want to filter a table for values less than X

select the visible values and then delete them,

some times there are not any vlaues less than X, so I get an error when trying to select the visible values,

I want to create an if statement saying if there are no visible values skip this part (this is where I have dificulties),

Please let me know if there is a better way of writing this,



        
        Worksheets("7-10 Data").ListObjects("Table1").Range.AutoFilter Field:=2, Criteria1:="<" & TimeMin(x), _
        Operator:=xlFilterValues
        
    'Delete Visible cells
        Application.DisplayAlerts = False
        Range("Table1").Select
        If Selection.SpecialCells(xlCellTypeVisible) = 0 Then
            Set RngToDelete = Selection.SpecialCells(xlCellTypeVisible)
            RngToDelete.Delete
        End If
        Application.DisplayAlerts = True