Q: delete rows

J

JIM.H.

Hello,

I have an excel file and I want to write a macro that delete all the rows
if D,E,F columns have zero values.
Can anyone give me a code for this?
Thanks,
 
D

David Hepner

This code is designed to delete the row if the columns D,E and F have a 0
value (not a blank).


Sub Macro1()
Dim i As Long
Dim c As Integer
c = 0
Application.ScreenUpdating = False

For i = 1 To 65536
If Range("D" & i).Value = c And Range("E" & i).Value = c And Range("F" &
i).Value = c Then
Rows(i & ":" & i).Select
Selection.Delete Shift:=xlUp
End If

Next i

Application.ScreenUpdating = True

End Sub
 
Top