View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
Tasha Tasha is offline
external usenet poster
 
Posts: 157
Default Delete rows with multiple columns with 0 value

That worked. The other one may have worked also, I finally figured out that
the July through December columns weren't pulling anything so they were blank
instead of 0's.... I filled all those in with 0's, reran macro and it
worked.... Thanks for your help!!!

"Jacob Skaria" wrote:

Try the below. All cells should be zero (not blank)

Sub Deleterows()
For lngRow = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
If WorksheetFunction.CountIf(Range("C" & lngRow & ":N" & lngRow), "0") _
= 12 Then Rows(lngRow).Delete
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Tasha" wrote:

On my spreadsheet, I want to delete rows that have 0 values in columns C
through N. If any of these columns have something other than 0, I need them
to stay. Can someone help me with a macro that would do this? I found a
post that would do this for 2 columns, but I couldn't figure out how to do it
for more than 2 columns.