T
Todd
Hello, I have a macro that deletes a row if it contains certain text in a
cell. I need to convert it to delete every row that does not have the
certain text in a cell.
So for the selected range, delete every row that does not have a cell that
says "cost".
Thanks,
Todd.
Sub DeleteRowifText()
Dim rng As Range
Dim what As String
what = "cost"
Do
Set rng = ActiveSheet.UsedRange.Find(what)
If rng Is Nothing Then
Exit Do
Else
Rows(rng.Row).Delete
End If
Loop
End Sub
cell. I need to convert it to delete every row that does not have the
certain text in a cell.
So for the selected range, delete every row that does not have a cell that
says "cost".
Thanks,
Todd.
Sub DeleteRowifText()
Dim rng As Range
Dim what As String
what = "cost"
Do
Set rng = ActiveSheet.UsedRange.Find(what)
If rng Is Nothing Then
Exit Do
Else
Rows(rng.Row).Delete
End If
Loop
End Sub