Try something like this;
Note: deletes Rows with Numbers ONLY ??
Sub FindValue_DeleteRow()
Dim Val As Range
Dim fWhat
Dim oCell As Range
fWhat = Application.InputBox("Enter Value to find", Type:=1)
If fWhat = False Then Exit Sub
Set Val = Cells.SpecialCells(2, 1)
On Error Resume Next
Do
Set oCell = Val.Find(What:=fWhat, LookIn:=xlValues, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=True)
oCell.EntireRow.Delete
Loop Until Err <> 0
End Sub
HTH
Ivan
Hi David,
This macro handles either text or numbers.
Sub FindDeleteRows()
' This macro deletes all rows having cells containing the
' specified input value (this value is prompted for).
Dim FindVal As String
Dim FoundCell As Range
Again:
FindVal = InputBox("Enter value to find", "Delete Rows Containing...")
If FindVal = "" Then Exit Sub
Set FoundCell = ActiveSheet.UsedRange.Find(FindVal, LookIn:=xlValues, _
lookat:=xlWhole, searchorder:=xlByRows)
Do While Not FoundCell Is Nothing
FoundCell.EntireRow.Select
If MsgBox("Delete this row", vbYesNo + vbQuestion, _
"Verify Row Deletion") = vbYes Then
FoundCell.EntireRow.Delete
Set FoundCell = ActiveSheet.UsedRange.FindNext
End If
Loop
If MsgBox("Another search?", vbYesNo + vbQuestion, _
"Not Found") = vbYes Then GoTo Again
End Sub
Happy computing.
Damon