The following code is determining if a cell in the row contains the word "Done". If it does then the row is copied to another sheet labled "Log" and removed from the list. Why might the following loop be skipping some rows that are marked "Done"?
Sub LogAndDelete()
Dim r As Integer
Dim Emptyrow As Integer
r = 1
For r = 5 To 70
If Cells(r, 15) = "Done" Then
'copying the row marked "Done"
rng = Range(Cells(r, 1), Cells(r, 7))
'determining the next empty row on log sheet
Emptyrow = _
Application.WorksheetFunction.CountA(Worksheets("Log").Range("A:A")) + 1
'Pasting onto log sheet
Range(Worksheets("Log").Cells(Emptyrow, 2), Worksheets("Log").Cells(Emptyrow, 8)) _
= rng
'Adding the date removed from log sheet in column A
Worksheets("Log").Cells(Emptyrow, 1) = Date
'Removing row marked "done" from list
Range(Cells(r, 1), Cells(r, 10)).ClearContents
Else
r = r + 1
End If
Next
End Sub
Thank you in advance for the help!