VBA Sub to delete rows based on a Column Value

  • Thread starter Thread starter DoctorV
  • Start date Start date
D

DoctorV

I have a workshhet named Final Short Quote. Anywhere in Column C wher
the cell conatins the word Remove, I want to delete that row. How can
do that
 
Hi
try the following macro:
Sub delete_rows()
Dim lastrow As Long
Dim row_index As Long
Application.ScreenUpdating = False
lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
For row_index = lastrow - 1 To 1 Step -1
If instr(Cells(row_index, 3).Value,"Remove")>0 then
Rows(row_index).delete
End If
Next
Application.ScreenUpdating = True
End Sub
 
Back
Top