Wow, that is beautiful. You guys make me look like a VBA preschooler, but
that is just fine with me. What would I do to look for a string in the
entire row, instead of just column H, would I do a bunch of "If" statements
or a Select case structure to find the desired string? I.E.,
For r = lastrow To 2 Step -1
If InStr(Cells(r, "h").Value, s) > 0 Then
Rows(r).EntireRow.Delete
End If
If InStr(Cells(r, "i").Value, s) > 0 Then
Rows(r).EntireRow.Delete
End If
If InStr(Cells(r, "j").Value, s) > 0 Then
Rows(r).EntireRow.Delete
End If
Next r
Or Is there a better, more efficient way?
--
thx for any help.... and again, wow.
dantee.
"Gary''s Student" wrote:
> Sub DeleterowsTRUST()
> Dim lastrow As Long, r As Long
> s = "TRUST"
> Application.ScreenUpdating = False
> lastrow = Cells(Rows.Count, "a").End(xlUp).Row
> For r = lastrow To 2 Step -1
> If InStr(Cells(r, "h").Value, s) > 0 Then
> Rows(r).EntireRow.Delete
> End If
> Next r
> Application.ScreenUpdating = True
> End Sub
>
> --
> Gary''s Student - gsnu200735
|