Sub test_V3()
Dim i%, val As Double
For i = Range("C65536").End(xlUp).Row To 5 Step -1
If IsEmpty(Cells(i, 5).Value) = True Or Cells(i, 7).Value = 0 Then
If Not Cells(i, 8) = 0 Then val = Cells(i, 8).Value
Rows(i).Delete
If Not Cells(i, 7).Value = 0 Then
[COLOR=blue]If i = 6 Then Cells(i - 1, 8).Value = val[/COLOR]
If Cells(i - 2, 7).Value = 0 Then Cells(i - 1, 8).Value = val
End If
End If
Next i
End Sub