View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone[_2_] Jim Cone[_2_] is offline
external usenet poster
 
Posts: 1,549
Default delete last-line help.

With Cells(Rows.Count, 1).End(xlUp)
If InStr(1, .Value, "MTD_AVG", vbBinaryCompare) 0 Then
.EntireRow.Delete
End If
End With
--
Jim Cone
Portland, Oregon USA
Review: http://www.contextures.com/excel-sort-addin.html

..
..
..

"Matthew Dyer"
wrote in message
I have a code that will delete the last line of a spreadsheet -
Range("a65536").End(xlUp).Select
Selection.EntireRow.Delete

What I'd like it to do is look into that line, and if the value for
the cell in column A is MTD_AVG to delete the line, but if it is
anything else to leave the line intact. Help please?