Non number cells

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I'm currently using the following Macro:

===============================================

Dim rng As Range
Dim lastrow As Long
Dim row_index As Long

lastrow = ActiveSheet.Cells(Rows.Count, 1).End(x1Up).Row
For row_index = lastrow - 1 Step -1
If Not IsNumeric(Cells(row_index, 1).Value) Then
Rows (row_index).delete
End IF
Next

===============================================

This will remove any row when a Cell in column "A" is
anyhting else than a number.

What do I need to add if, after doing this first Macro, I
would like to do the same thing but the Cells in
column "C"???

Thanks!!!
 
Hi,

This will look in col C and delete the row

change IsNumeric(Cells(row_index, 1).Value)
to IsNumeric(Cells(row_index, 3).Value)

jeff
 
Hi,

Thanks for the answer!!!

Will this also delete rows in which the cell in
column "C" is empty???

Thanks!!!
 
Save your workbook and then try it!

If Not application.isnumber(Cells(row_index, 3).Value) Then

is more stringent.
 
Back
Top