How to merge 2 excel sheets (specific column only)

How to merge 2 excel sheets (specific column only)

I want to merge the “Number” column of Sheet1 and Sheet2 in one excel.

Book2.xlsx (10.4 KB)

@prititit

You mean want to read Number column from both the sheets and then merge and write into separate sheet ?

If yes then follow below steps.

  1. Use 2 Read Range activities to read entire data from both the Excel sheets. Let’s say ‘InputDT1’ and ‘InputDT2’.

  2. And then use two more Read Range activities to read only “Number” Columns and pass range as below. Let’s say ‘NumberDT1’ and ‘NumberDT2’.

       Range:"B1:B"+InputDT1.Rows.Count.ToString
    

Range:“B1:B”+InputDT2.Rows.Count.ToString

Note: Replace “B” with specific column index based on your input file.

  1. And then use Merge DataTable activity and set source as ‘NumberDT1’ and Destination as ‘NumberDT2’.

  2. And then use Write Range activity and pass ‘NumberDT2’ to write into Excel file.

Hello @lakshman

In creating the merge data table, is it supposed to be new dt in the Source and Destination?

Thank you

@prititit

You can merge one DataTable to other by specifying Source and Destination DataTable. Then Source DataTable will be added to Destination Table.

Thanks, @lakshman !

It worked! :smiley:

1 Like

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