I have used and adapted code from another thread on the site however there was errors regarding the size of copy and paste due to using EntireRow. On one sheet I have a data validation list of either outstanding or completed with the aim for excel to cut and paste the row to the "Done" worksheet at the bottom of the exisiting database. The existing code I have reads as follows.
Sub fromOutstanding()
' Move rows from Outstanding to Completed If Column K has a Completed in it.
lastrow = Worksheets("To Do").UsedRange.Rows.Count
lastrow2 = Worksheets("Done").UsedRange.Rows.Count
If lastrow2 = 1 Then
lastrow2 = 0
Else
End If
Do While Application.WorksheetFunction.CountIf(Range("K1:K"), "Completed") > 0
Set Check = Range("K1:K" & lastrow)
If Cell = "Completed" Then
For Each Cell In Checkn
Cell.Range("A:K").Copy Destination:=Worksheets("Done").Range("A" & lastrow2 + 1)
Cell.Range("A:K").Delete
lastrow2 = lastrow2 + 1
Else:
End If
Next
Loop
End Sub
Any help would be appreciated
Sub fromOutstanding()
' Move rows from Outstanding to Completed If Column K has a Completed in it.
lastrow = Worksheets("To Do").UsedRange.Rows.Count
lastrow2 = Worksheets("Done").UsedRange.Rows.Count
If lastrow2 = 1 Then
lastrow2 = 0
Else
End If
Do While Application.WorksheetFunction.CountIf(Range("K1:K"), "Completed") > 0
Set Check = Range("K1:K" & lastrow)
If Cell = "Completed" Then
For Each Cell In Checkn
Cell.Range("A:K").Copy Destination:=Worksheets("Done").Range("A" & lastrow2 + 1)
Cell.Range("A:K").Delete
lastrow2 = lastrow2 + 1
Else:
End If
Next
Loop
End Sub
Any help would be appreciated