Non Numbers Cells

B

Benoit

Hello,

I would like to know if I can create a Macro that will do
a search in column A (from A2 to A65536) and every row
that has anything else than a number, delete the entire
row (not just the cell).

Thanks!!!
 
F

Frank Kabel

Hi
try the following macro:
Sub delete_rows()
Dim lastrow As Long
Dim row_index As Long
Application.ScreenUpdating = False
lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
For row_index = lastrow - 1 To 1 Step -1
If not isnumeric(Cells(row_index, 1).Value) then
Rows(row_index).delete
End If
Next
Application.ScreenUpdating = True
End Sub
 
Top