Move Completed Rows to Another Sheet in Excel VBA With Newest First
Question details
Move worksheet rows whose status is marked Completed to another sheet and show the newest completed records first.

- Product
- Microsoft Excel VBA macro
- Device & OS
- not provided
- Scenario
- A workbook uses a status column to identify completed records and needs to archive or transfer those records to a Completed worksheet.
- Observed behavior
- Completed rows need to be transferred without skipping records, with the most recently completed items displayed at the top of the destination sheet.
Confirm the source and destination worksheet names, the column containing the Completed status, and whether row 1 contains headers. If newest order is based on a date, ensure every transferred row has a valid completion date in the same date column.
Move completed rows from bottom to top and insert them below the destination header
Use this approach when the source list is already in chronological order and you want each newly moved completed row to appear at the top of the Completed sheet.
Looping from the last source row upward prevents the macro from skipping rows after it deletes a moved row. Inserting each record at row 2 keeps the header in row 1 and places the latest processed record first.
In Excel, press Alt+F11, select Insert > Module, and paste the macro into the new code module.
Update the code references such as Worksheets("Active") and Worksheets("Completed") to match your workbook. Change the status-column reference Cells(r, "G") if Completed is stored in another column.
Paste and run this macro from the VBA editor: Sub MoveCompletedRows()\n Dim wsSource As Worksheet, wsCompleted As Worksheet\n Dim lastRow As Long, r As Long\n\n Set wsSource = Worksheets("Active")\n Set wsCompleted = Worksheets("Completed")\n lastRow = wsSource.Cells(wsSource.Rows.Count, "A").End(xlUp).Row\n\n For r = lastRow To 2 Step -1\n If LCase(Trim(wsSource.Cells(r, "G").Value)) = "completed" Then\n wsCompleted.Rows(2).Insert Shift:=xlDown\n wsSource.Rows(r).Copy Destination:=wsCompleted.Rows(2)\n wsSource.Rows(r).Delete\n End If\n Next r\nEnd Sub
Press F5 while the cursor is inside MoveCompletedRows, or return to Excel and select Developer > Macros > MoveCompletedRows > Run. Confirm that completed records are on the Completed sheet directly below its header.

Copy completed rows and sort the destination sheet by completion date
Use this approach when newest means the most recent value in a completion-date column rather than the row's original position.
Organize Completed Records With WPS Spreadsheet Macros and Sorting
WPS Spreadsheet provides familiar worksheet tools for marking completed items, transferring records with supported macros, and sorting a completion-date column so the newest records remain at the top.
- 1. Open the workbook in WPS Spreadsheet: Launch WPS Office, select Spreadsheets, and open the Excel workbook containing your status and completion-date columns.
- 2. Check the status and destination sheets: Verify the source worksheet, the Completed worksheet, and the column where users enter Completed.
- 3. Run or edit the macro: Open the macro or VBA editor available in your WPS Spreadsheet edition, update the worksheet and column references, then run the completed-row procedure.
- 4. Sort the completed records by date: On the Completed sheet, select the completed data table and choose Data > Sort, then set the completion-date column to descending order.

Frequently Asked Questions
Why should the macro loop from the last row to the first row?
Deleting a source row shifts all rows below it upward. A loop such as For r = lastRow To 2 Step -1 avoids skipping the next record after a deletion.
How do I keep the headers on the Completed sheet?
Keep headers in row 1 and insert or copy transferred records into row 2. For example, use wsCompleted.Rows(2).Insert before copying the completed source row.
Can I copy completed rows without deleting them from the original sheet?
Yes. Remove or comment out the line wsSource.Rows(r).Delete from the macro. The record will remain on the source sheet after it is copied to the Completed sheet.
What if my Completed status is not in column G?
Change Cells(r, "G") in the status test to the correct column letter or use a column number. For example, Cells(r, "D") checks column D.
How can I make sure the newest completed item is first?
If source rows are already ordered by completion time, insert each moved record at row 2 while looping from bottom to top. Otherwise, use Data > Sort on the Completed sheet and sort the Completion Date column from Newest to Oldest.




