Thread: Delete Rows
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
EJ EJ is offline
external usenet poster
 
Posts: 20
Default Delete Rows

Sub DeleteRows()
Dim i As Long, LastRow As Long
LastRow = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row

For i = LastRow To 1 Step -1
If Cells(i, 6) = 0 Then Rows(i).Delete
Next


End Sub

I would like to get some help with this macro. Currently it is deleting
more rows than I want it to delete. I would like it to

Look at each row in Column A.

If the row in Column A has contents in it than check the same row of Column
F.

If the contents in Column F are equal to or greater than 0 delete the row
and keep deleting the rows below it until Column A has contents in it again.

Repeat for every row in Column A and Column F.