Split an Excel file into 2 Datatables based on a cell value

I have this excel report which can have multiple Batch Numbers.image image
In the middle and at the end. The middle one denotes the first Batch of Transactions and the last one the second batch of Transactions. I want to split the Excel into batches(separate data tables) based on the Batch numbers it has. Please guide. Thanks.


Can you share your excel file? It’s no problem if dummy data.


Hi @Rachita_Chauhan ,

You can first get the index(row number) where there is a keyword called ‘Batch Number’, Once you get the index you can use two different read ranges like below:(Using index reference to read different parts)
Read Range1:“A1:C”+index.ToString
Read Range2:“A”+index.ToString+“:C”+(datable.rows.count+1).ToString