I adjusted the code to copy the record correctly. I highlighted the changed code
Sub movearound()
Dim r, r2, rmax, rw
datasheet = "Pickup Screen"
outsheet = "Cost Management"
Application.ScreenUpdating = False
r2 = Sheets(outsheet).Range("A" & Rows.Count).End(xlUp).Row + 1
r = 9
While r <= Sheets(datasheet).Range("A" & Rows.Count).End(xlUp).Row
If Sheets(datasheet).Range("P" & r) = "Delivered" Then
For c = 1 To 16
Sheets(outsheet).Cells(r2, c) = Sheets(datasheet).Cells(r, c)
Next c
Sheets(datasheet).Select
Rows(r & ":" & r).Select
Selection.Delete Shift:=xlUp
r2 = r2 + 1
r = r - 1
End If
r = r + 1
Wend
Sheets(datasheet).Select
Columns("A:Z").AutoFit
Application.ScreenUpdating = True
End Sub
Bookmarks