Hi,
If these 'rows' only appear once then it shouldn't be too onerous to do it
manually so I'm assuming there are many instances. This will delete all rows
except those that have either of thos string in column A
Sub Sonic()
Dim R As Range
Dim V As Variant
Dim S As String
Dim CopyRange As Range
Set Sht = Sheets("Sheet1")'change to suit
lastrow = Sht.Cells(Cells.Rows.Count, "A").End(xlUp).Row
S = "AWH98228,AWL99467"
V = Split(S, ",")
For Each R In Sht.Range("A1:A" & lastrow)
If IsError(Application.Match(CStr(R.Value), V, 0)) Then
If CopyRange Is Nothing Then
Set CopyRange = R.EntireRow
Else
Set CopyRange = Union(CopyRange, R.EntireRow)
End If
End If
Next R
If Not CopyRange Is Nothing Then
CopyRange.Delete
End If
End Sub
--
Mike
When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
"joshman" wrote:
> I receive a weekly report & have been asked to delete all rows except
> for two particular rows. Here are the two criteria which are in column
> A cells:
>
> AWH98228 and AWL99467
>
> Can anyone offer help?
>
> Thanks
> .
>
|