Copy Rows to Another Sheet When Criteria Are Met in Excel
Question details
The user wants all rows that meet a criterion to appear on another worksheet.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Compare Actual and Expected values and transfer each matching row to a destination sheet.
- Observed behavior
- A macro can leave only the last matching row when every paste uses the same destination range.
Identify the source and destination sheets and confirm which columns contain Actual and Expected values. For the FILTER solution, make sure the source is an Excel table named Table1 with columns named Actual and Expected.
Use FILTER to return all matching rows
Use this approach in Excel 2021 or Microsoft 365 when you want results to update automatically.
Click inside the source table and use the Table Design tab to check its name. Confirm that its headers include Actual and Expected.
On the destination sheet, select an empty cell and enter =FILTER(Table1,Table1[Actual]<Table1[Expected],"None"). Adjust the table or column names if yours differ.
Press Enter. Excel spills every matching row below and beside the formula cell; clear any cells blocking the spill area if you see a #SPILL! error.

Increment the destination row in a VBA macro
Use VBA when you need independent copies or your Excel version does not support FILTER.
Filter and copy matching rows in WPS Spreadsheets
Use a helper column and the filter controls in WPS Spreadsheets to find rows where Actual is less than Expected, then copy the matches to another sheet.
- 1. Open the workbook: Open your workbook in WPS Spreadsheets and identify the Actual and Expected columns.
- 2. Add a helper formula: In an empty column, enter a header such as Match. If Actual is in column C and Expected is in column D, enter =C2<D2 in the first data row and fill the formula down.
- 3. Filter for matches: Select the data range, choose Data > Filter, and use the Match column's filter menu to show TRUE values.
- 4. Copy the visible results: Select the filtered data cells you want to transfer and use Copy. Check that the selection contains the intended matching rows.
- 5. Paste into another sheet: Open or add the destination sheet, select the starting cell, and choose Paste. Verify that each matching row appears once.

Frequently Asked Questions
Why does my macro copy only the last matching row?
The paste destination may be fixed. Set a destination row variable before the loop and increment it after each successful copy so the next match uses a new row.
Will FILTER include new rows added to the source table?
Yes. When new records are added to the Excel table, a formula such as =FILTER(Table1,Table1[Actual]<Table1[Expected],"None") evaluates them automatically.
What if my version of Excel does not have FILTER?
Use a VBA macro that increments the destination row after each copy, or use an INDEX and SMALL array formula. You can also filter a helper column and copy the matching rows manually.
Why does the FILTER formula show #SPILL!?
The cells needed for the results may contain data or otherwise block the spill range. Clear the destination area around and below the formula, then check the result again.




