How can If InStr
be used to remove a row which contain space with word zk and space, like " zk "?
Sub RemoveRows1()
Dim j As Long
j = 1
Do While j <= ThisWorkbook.ActiveSheet.Range("D1").CurrentRegion.Rows.Count
If InStr(1, ThisWorkbook.ActiveSheet.Cells(j, 4).Text, "(L/C)", vbTextCompare) > 0 Then
ThisWorkbook.ActiveSheet.Cells(j, 4).EntireRow.Delete
ElseIf InStr(1, ThisWorkbook.ActiveSheet.Cells(j, 4).Text, "ABC", vbTextCompare) > 0 Then
ThisWorkbook.ActiveSheet.Cells(j, 4).EntireRow.Delete
ElseIf InStr(1, ActiveSheet.Cells(j, 4).Text, " ZK ", vbTextCompare) > 0 Then Rows(j).EntireRow.Delete
Else
j = j + 1
End If
Loop
End Sub