Do you mean the code stops with a run-time error? If you post the code I (or someone) should be able to sort it.
Regards,
Dax.
Cheers Dax
It's giving me the error message "Object variable or with block variable not set"
While IsEmpty(Selection) = False
Range("A1:A700").Select
Selection.Find(What:="TIMING", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False) _
.Activate
ActiveCell.EntireRow.Select
Selection.Delete
Selection.Delete
Selection.Delete
Selection.Delete
Selection.Delete
Selection.Delete
Wend
How about this?
Sub DeleteRows()
Dim rngeFound As Range, rngeSearchRange As Range
Set rngeSearchRange = ActiveSheet.Range("A1:A700")
Do
Set rngeFound = rngeSearchRange.Find("TIMING")
On Error Resume Next
If rngeFound.Rows.Count = 0 Then Exit Sub
On Error GoTo 0
ActiveCell.EntireRow.Select
rngeFound.Resize(6, 1).EntireRow.Delete
Loop
End Sub
Hope it helps,
Dax.
Re: Slight change to code...
You don't need the line
ActiveCell.EntireRow.Select
as I posted. This will avoid the code having to select anything hence speeding it up nicely.
Regards.