Option Explicit
Sub DelUnNeeded()
Dim rng As Range, lPos As Range
Dim celle As Range, wks As Worksheet
Dim i As Long, FinalRow As Range
Dim c As Long
With Sheets("PIDs")
Set rng = Range(.Cells(4, "H"), .Cells(.Rows.Count, "H").End(xlUp))
End With
i = 4
On Error Resume Next
With Sheets("PIDs")
For Each celle In rng
If Cells(i, 8) = "VACANT POSITION" Then Rows(i).Delete
Set lPos = Cells(i, 11)
If Left(lPos, 11) = "115528" Then Rows(i).Delete
If Left(lPos, 11) = "124957" Then Rows(i).Delete
i = i + 1
Next
End With
End Sub
|