R
Robert
The following deletes rows where there is no matching text in column B
Dim RowNdx As Long
Dim LastRow As Long
LastRow = Cells(Rows.Count, "B").End(xlUp).Row
For RowNdx = LastRow To 5 Step -1
If Not (Cells(RowNdx, "B").Value = "EB1" Or _
Cells(RowNdx, "B").Value = "EB10" Or _
Cells(RowNdx, "B").Value = "EB11" Or _
Cells(RowNdx, "B").Value = "EB2" Or _
Cells(RowNdx, "B").Value = "EB3" Or _
Cells(RowNdx, "B").Value = "EB8" Or _
Cells(RowNdx, "B").Value = "EB9" Or _
Cells(RowNdx, "B").Value = "EE3" Or _
Cells(RowNdx, "B").Value = "EE6" Or _
Cells(RowNdx, "B").Value = "EF2" Or _
Cells(RowNdx, "B").Value = "EF3" Or _
Cells(RowNdx, "B").Value = "EG2" Or _
Cells(RowNdx, "B").Value = "WR") Then
Rows(RowNdx).Delete
End If
Next RowNdx
Unfortunately I now need to expand the number of criteria considerably
and have come up against the limit.
Grateful for suggestions as to how I can get around this.
Dim RowNdx As Long
Dim LastRow As Long
LastRow = Cells(Rows.Count, "B").End(xlUp).Row
For RowNdx = LastRow To 5 Step -1
If Not (Cells(RowNdx, "B").Value = "EB1" Or _
Cells(RowNdx, "B").Value = "EB10" Or _
Cells(RowNdx, "B").Value = "EB11" Or _
Cells(RowNdx, "B").Value = "EB2" Or _
Cells(RowNdx, "B").Value = "EB3" Or _
Cells(RowNdx, "B").Value = "EB8" Or _
Cells(RowNdx, "B").Value = "EB9" Or _
Cells(RowNdx, "B").Value = "EE3" Or _
Cells(RowNdx, "B").Value = "EE6" Or _
Cells(RowNdx, "B").Value = "EF2" Or _
Cells(RowNdx, "B").Value = "EF3" Or _
Cells(RowNdx, "B").Value = "EG2" Or _
Cells(RowNdx, "B").Value = "WR") Then
Rows(RowNdx).Delete
End If
Next RowNdx
Unfortunately I now need to expand the number of criteria considerably
and have come up against the limit.
Grateful for suggestions as to how I can get around this.