<img src="//trc.taboola.com/1222697/log/3/unip?en=page_view" width="0" height="0" style="display:none">


The Knowledgebase articles are deprecated. Please visit the new Guides and Resources here: https://www.uipath.com/developers/guides-and-resources.

Knowledge Base

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

  1. Read Sheet1.
  2. Read Sheet2.
  3. Get the number of columns for each sheet.
  4. Check if both DataTables have the same number of columns.
  5. If their sizes are the same ask the user to enter the number of the first row and the second row.
  6. Compare the rows.
  7. Display if the rows have the same information or not.


  1. Read Sheet1 and Sheet2 using "Read Cell Range" activity.
  2. Using "Assign" activity saves in two variables the number of columns of each data table.
  3. Compare if the number of columns is equal using a "Flow Decision" activity.
  4. If the number of columns is not equal then display a message using "Message Box" activity.
  5. Otherwise, use a "Input Dialog" activity to allow the user to insert the rows that he/she wants to compare.
  6. Using a "While" activity to compare the rows.
  7. Display if the rows have the same information or not using a "Message Box" activity.


Read more about Excel Automation here.