mercredi 25 juillet 2018

Deleting Row that It Shouldn't

Can someone help me understand why my code is bugging out?

The code is below and this is some sample data. Without fail it deletes the first row that has a percent.

Thanks in advance :)

`With ThisWorkbook.Sheets(1)
    hcRow = Cells(Rows.Count, "A").End(xlUp).Row
    p = 5
        For i = 4000 To 1 Step -1
        .Cells(i, p).Value = Format(.Cells(i, p).Value, "Percent")
            If .Cells(i, p).Value < 0.01 Then
                .Cells(i, p).EntireRow.Delete
                '.Cells(i, p).Interior.ColorIndex = 3
            End If
        Next i
End With`

Aucun commentaire:

Enregistrer un commentaire