delete rows where value in Column B=0

  • Thread starter Thread starter sek0910
  • Start date Start date
S

sek0910

I have a worksheet with 2 columns and 21585 rows.
I want to delete all of the rows where there is a value of "0" in column B.
Any suggestions?

Thanks,
Steve
 
NEVER MIND, I FIGURED IT OUT

I just filtered for "0", selected all the rows, then deleted them.
 
Maybe

Sub Macro2()
lastrow = Cells(Rows.Count, "B").End(xlUp).Row
For x = lastrow To 1 Step -1
If IsNumeric(Cells(x, 2).Value) And Cells(x, 2).Value = 0 Then
Rows(x).EntireRow.Delete
End If
Next
End Sub

Mike
 

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