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

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??
 
T

Tushar Mehta

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
 
P

Peruanos72

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top