View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Chip Pearson
 
Posts: n/a
Default Delete rows if specific criteria not met.

Try

Dim LastRow As Long
Dim RowNdx As Long
LastRow = Cells(Rows.Count, "B").End(xlUp).Row
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "B") < "Remittance" Then
Rows(RowNdx).Delete
End If
Next RowNdx


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"SITCFanTN" wrote in
message
...
I have a spreadsheet with 8 columns. I want to delete all rows
that don't
have the text "Remittance" in column B. I would like to put
the code in an
existing macro. Is this very difficult? Thanks