If value delete row
Sorry read your post again it must be John Doe that triggered the delete do
try:-
Sub Deleterows()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim lastrow As Long, r As Long
lastrow = ActiveSheet.UsedRange.Rows.Count
For r = lastrow To 1 Step -1
If Cells(r, 1).Value = "John Doe" Then Rows(r).Delete
Next r
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
Note this is case sensitive for John Doe. Will that do?
Mike
"Lost in Microbiology" wrote:
I need to evaluate one column and if it contains specific text, then I want
the entire row's information cleared. If there a function or macro that could
do this?
Example
A B C D
NAME NUMBER DATE FINAL
1 John Doe 123 3/9/2007 Growth of
2 Jane Smith 456 3/9/2007 Bug1
3 Bill Doe 789 3/9/2007 BugA
In this case I would want row 1 to either have contents cleared or row 1 to
be deleted.
|