Hello folks:
I am trying to filter and delete in column O anything that does not equal "W". My code keeps erroing out. I think is on the <> sign.
I am trying to filter and delete in column O anything that does not equal "W". My code keeps erroing out. I think is on the <> sign.
Sub filterMinorityEE()
'Filter all of the minority employees.
Dim LastRow As Long
sheets("minority").Select
LastRow = Range("O" & Rows.Count).End(xlUp).Row
If WorksheetFunction.CountIf(Range("O5:O" & LastRow), <> "W") Then
Application.ScreenUpdating = False
Range("O4:O" & LastRow).AutoFilter Field:=1, Criteria1:<>"W"
Range("O5:O" & LastRow).SpecialCells(xlCellTypeVisible).EntireRow.Delete
ActiveSheet.AutoFilterMode = False
Application.ScreenUpdating = True
End If
End Sub