Excel automation. Compare Rows From Different Tables
To be able to run this example you need to install UiPath.Excel.Activities. See more details on how to install packages here.
This sample compares a row from sheet1 with another row from sheet2.
Steps to automate
- Read Sheet1.
- Read Sheet2.
- Get the number of columns for each sheet.
- Check if both DataTables have the same number of columns.
- If their sizes are the same ask the user to enter the number of the first row and the second row.
- Compare the rows.
- Display if the rows have the same information or not.
- Read Sheet1 and Sheet2 using "Read Cell Range" activity.
- Using "Assign" activity saves in two variables the number of columns of each data table.
- Compare if the number of columns is equal using a "Flow Decision" activity.
- If the number of columns is not equal then display a message using "Message Box" activity.
- Otherwise, use a "Input Dialog" activity to allow the user to insert the rows that he/she wants to compare.
- Using a "While" activity to compare the rows.
- Display if the rows have the same information or not using a "Message Box" activity.
Read more about Excel Automation here.