Compare 2 excel files row item and paste in 3rd excel file

Hi Team,

I have 2 excel files.

Let suppose 1st file have 20 columns out of 2 column name is Company and Amount.

2nd file have 30 columns out of 2 column names is CompanyCode and AmountTotal.

lets say in 1st file company & Amount value is UH09 and 73636
if this 2 column value is matched with the 2nd excel file CompanyCode and Amount column.

Then i want to paste the matched row data with all 30 columns of 2nd excel file in 3rd excel file.

Use Join Activity


Sry Raja let me be more specific
Ex - if Company and. Amount value is PWC and 7677 in 1st excel file and if this value match with the 2nd excel CompanyCode and Amount then the bot will paste the matched row item in 3rd excel.

again the bot will match next company and amount value of 1st excel file with 2nd excel file , if that matched then i want to paste the 2nd excel matched row value in 4th excel file.
and so on…

How can we achieve that?

Hi @Shivam_Rana

Can you try this-

  1. Excel Application Scope (to open first Excel file)

    • Read Range (store data in DataTable variable: dt1)
  2. Excel Application Scope (to open second Excel file)

    • Read Range (store data in DataTable variable: dt2)
  3. For Each Row (in dt1)

    • If (Condition: dt2.AsEnumerable().Any(Function(row) row(“CompanyCode”).ToString = row(“Company”).ToString AndAlso row(“AmountTotal”).ToString = row(“Amount”).ToString))
      • Add Data Row (row from dt2 to new DataTable or collection)
  4. Excel Application Scope (to create/open third Excel file)

    • Write Range (write the new DataTable or collection to the third Excel file)


1 Like

@Nitya1 no its not working

Team pls provide the solution :pray:t2:


1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.