Delete row if value is zero

K

KWhamill

I'm trying to create an if statement that will delete entire rows where the
value in Column N is less than .01 or efectively zero for my purposes. The
little bit i've figured out will delete the row but only if the whole row is
blank. If any one can help me all the better.
Thank you,
Karl
 
S

Susan

======================
Option Explicit

Sub step_backwards()


Dim myLastRow As Long
Dim r As Long
Dim c As Range


myLastRow = ActiveSheet.Cells(10000, 1).End(xlUp).Row


For r = myLastRow To 1 Step -1
Set c = ActiveSheet.Range("a" & r)
If c.Value = "" Then
c.EntireRow.Delete
End If
Next r


End Sub
=========================
it looks for blanks in column A. change that if you need to.
hope it helps
:)
susan
 

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