I need to merge more than 100 excel files

Good morning

How could you merge excel files? I am talking about approximately more than 100 excel files that must be joined or merged into a single file, and later uploaded to google sheet.

Excel files have the same format of fields, columns, etc.


Welcome to the community

  1. Use for each file in folder activity with filter on .xlsx
  2. Inside the loop use read ramge workbook and read the data into datatable
  3. Use if condition to check if this is the first iteration currentindex=0
  4. On then side use finaldt = dt.Clone and then finaldt = dt.CopyDataTable
  5. Else side use merge datatable and merge dt with finaldt
  6. Outside loop use write range and write the finaldt to new excel



Hope the following sample helps you.

Sample20230531-3.zip (15.3 KB)


1 Like