View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ste mac[_2_] ste mac[_2_] is offline
external usenet poster
 
Posts: 4
Default Find the word "total" in a cell, delete row or column

Hi Lawlerd, this code was posted by Frank Kabel, it should do what you
you need, it will delete every row with the word 'total' in column A...

Sub delete_rows()
Dim RowNdx As Long
Dim LastRow As Long
LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).row
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "A").Value = "total" Then
Rows(RowNdx).Delete
End If
Next RowNdx
End Sub

ste