checoturco
12-28-2005, 01:44 AM
hi all,
i have a code to delete a row if a cell has a 0(zero) value, this is the code:
For i = 1 To 1000
If .Cells(i, "E").Value = 0 Then
.EntireRow(i).Delete
enf if
next
what happens itīs that if i had 2 cells with 0, i.e.
cell(1E)=0
cell(2E)=0
it delete the row cell(1E) and donīt delete row with cell(2E) because this cell becames cell(1E) and next loop goes to next cell.
somebody has any idea to fix this?
tks
i have a code to delete a row if a cell has a 0(zero) value, this is the code:
For i = 1 To 1000
If .Cells(i, "E").Value = 0 Then
.EntireRow(i).Delete
enf if
next
what happens itīs that if i had 2 cells with 0, i.e.
cell(1E)=0
cell(2E)=0
it delete the row cell(1E) and donīt delete row with cell(2E) because this cell becames cell(1E) and next loop goes to next cell.
somebody has any idea to fix this?
tks