Delete row if cell in column "E" has 1 or more alpha characters

  • Thread starter Thread starter Peruanos72
  • Start date Start date
P

Peruanos72

I'm trying to delete rows of data after row 4 if the cell in column "E" has
any alpha characters in it at all. If the cell in column "E" is all numeric
then no action is taken on that row. Thoughts??
 
This is probably OK with the OP but it does delete rows where the corr. col E
cell contains a string with only numbers. For example, it deletes a row with
'5 in the corresponding col. E cell.

--
Tushar Mehta
http://www.tushar-mehta.com
Custom business solutions leveraging a multi-disciplinary approach
In Excel 2007 double-click to format may not work; right click and select
from the menu
 
This worked beautifully. Thx!!!

Per Jessen said:
Try this:

Sub DeleteNonNumericRows()
LastRow = Range("E" & Rows.Count).End(xlUp).Row
For r = LastRow To 4 Step -1
If Not IsNumeric(Cells(r, "E")) Then
Rows(r).Delete
End If
Next
End Sub

Hopes this helps.
 
Back
Top