To copy data from one Excel file to another based on a specific criterion (e.g., name) using UiPath, you can follow these steps:
Use the “Excel Application Scope” activity to open the source Excel file.
Use the “Read Range” activity to read the data from the source Excel sheet into a DataTable.
Use DataTable activities to filter the data based on the name criterion. You can use the “Filter Data Table” activity or write custom logic to filter rows where the name matches your desired criteria.
If needed, create a new DataTable to store the filtered data. You can use the “Build Data Table” activity to define the structure of the new table.
Use the “Excel Application Scope” activity to open the destination Excel file.
Use the “Write Range” activity to write the filtered data (either the entire DataTable or the rows that meet the criterion) to the destination Excel sheet.
Save and close the destination Excel file using the “Save Workbook” and “Close Workbook” activities within the “Excel Application Scope.”
Close the “Excel Application Scope” for both the source and destination files.
You can adjust the filtering logic, column names, and other details based on your specific Excel files and criteria.