Thread: Delete Row
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Otto Moehrbach Otto Moehrbach is offline
external usenet poster
 
Posts: 1,090
Default Delete Row

This should do it. Post back if you need more. HTH Otto
Sub DeleteTotal()
Dim i As Long
Dim iLastRow As Long
iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = iLastRow To 1 Step -1
If Cells(i, "A").Value = "Total" Then
Rows(i).Delete
End If
Next i
End Sub

"Tempy" wrote in message
...
Hi, the code below is what i found from searching and it was from Bob, I
need to convert it to find the word "Total" and delete that row with
total in it, But i am not too sure how to modify it ?

Could somebody please help?

Dim i As Long
Dim iLastRow As Long

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = iLastRow To 1 Step -1
If Cells(i, "A").Value < 6500 And Cells(i, "A").Value 5599
Then
Rows(i).Delete
End If
Next i


Tempy

*** Sent via Developersdex http://www.developersdex.com ***