Non Numbers Cells

  • Thread starter Thread starter Benoit
  • Start date Start date
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!!!
 
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
 

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

Back
Top