Data Import & Export

Transfer Only Edited or New Excel Rows to Another Worksheet

Jason MillerJason Miller Nov 11, 2026 868 views

Question details

The user needs to extract and transfer only new, modified, or deleted records from a large Excel dataset to another worksheet to speed up daily database exports.

How to Transfer Only Edited or New Excel Rows to Another Worksheet
Product
Excel
Device & OS
not provided
Scenario
Exporting daily updates from a large staff list to another database without processing the entire worksheet.
Observed behavior
Manually copying thousands of rows or processing the complete worksheet is too slow and inefficient. The goal is to automate the extraction of changed data.
Before you start

Ensure your worksheet has a column with unique identifiers (such as Employee IDs) to accurately compare records, and save a backup copy of your workbook before running any macros.

Solution 1Recommended

Use a VBA Macro to Identify and Transfer New Rows

A VBA script can automatically compare your source sheet against a destination sheet using unique IDs, transferring only the rows that do not yet exist in the destination.

Formulas alone cannot detect or log worksheet changes over time. Using VBA (Visual Basic for Applications) provides a scalable way to compare records based on a unique identifier and push new or altered records to a staging sheet.

1
Open the VBA Editor

Press ALT + F11 in your Excel workbook to open the Microsoft Visual Basic for Applications window.

2
Insert a new Module

Click 'Insert' from the top menu and select 'Module'. Paste your VBA code (like the TransferEditedRows macro) into the blank module window.

3
Customize the VBA script

Modify the script to match your sheet names (e.g., 'SourceSheet' and 'DestinationSheet') and ensure the column references align with your unique ID column (e.g., Column A).

4
Run the Macro

Close the VBA editor, return to your workbook, press ALT + F8, select 'TransferEditedRows', and click 'Run'. Remember to save your file as a Macro-Enabled Workbook (.xlsm).

Use a VBA Macro to Identify and Transfer New Rows
Detecting Deletions and Edits: A basic macro identifies new records by checking if the ID exists. To track deleted or modified rows, you will need a more advanced VBA script that stores a daily snapshot for comparison.

Automate Data Transfers with WPS Spreadsheet

WPS Spreadsheet provides robust support for VBA macros, Power Query-like data processing, and advanced formulas. You can seamlessly run Excel macros (.xlsm) to automate your daily staff list exports for free.

  1. 1. Download and Install: Get WPS Office from the official website and install it on your device.
  2. 2. Open your Workbook: Launch WPS Spreadsheet and open your existing Excel file containing the staff list and VBA macros.
  3. 3. Enable Macros: Go to the 'Developer' tab, click 'Macros', and run your VBA script to transfer the new or edited rows instantly.
Fully compatible with Microsoft Excel .xlsm and .xlsx formatsBuilt-in VBA macro editor for automating repetitive tasksLightweight and fast even with large datasetsFree to download and use
microsoft office alternative - wps office

Frequently Asked Questions

Why can't I use standard Excel formulas like VLOOKUP to transfer edited rows?

Formulas update dynamically based on the current state of the worksheet. They cannot store historical data or detect the specific event of a row being edited or deleted, which is required to log changes over time.

Will the VBA macro run automatically when a cell is edited?

A standard macro requires you to run it manually (e.g., by clicking a button). If you want it to run automatically upon editing, you need to use the Worksheet_Change event in VBA, though this may slow down performance for large datasets.

How do I export the isolated changes to my database?

Once your macro or Power Query places the new or edited rows into the destination worksheet, you can save that specific sheet as a CSV file and import it directly into your database system.

What happens if I don't have a unique ID for each row?

Without a unique identifier (like an Employee ID), VBA and Power Query cannot accurately determine if a row is new, modified, or a duplicate. You will need to create a unique key, perhaps by concatenating columns like First Name, Last Name, and Date of Birth.