ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   delete row if text in cell (https://www.excelbanter.com/excel-programming/380782-re-delete-row-if-text-cell.html)

Otto Moehrbach

delete row if text in cell
 
Add another "Or" and add "Not IsNumeric(.Cells(Lrow, "H"))
HTH Otto
"KelliInCali" wrote in message
...
I need to identify a row in which column D contains text in order to delete
the row.

Basically, I want to delete any rows for which D does not have a whole
number greater than zero.

Here is what I'm already working with, which identifies blanks and numbers
less than zero, but it does not remove rows that remain containing text.

With ActiveSheet
.DisplayPageBreaks = False
StartRow = 1
EndRow = .Cells(.Rows.Count, "D").End(xlUp).Row

For Lrow = EndRow To StartRow Step -1
If .Cells(Lrow, "H").Value < 0.01 Or _
.Cells(Lrow, "H").Value = "" Then
.Rows(Lrow).Delete
End If

Next
End With

tia,
kelli





All times are GMT +1. The time now is 11:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com