You’re writing the entire data each time it loops, not just one row.
So how can i fix that ?
Don’t loop. You don’t need to. You’re thinking of it as processing one row at a time, but that’s not how Read Range and Write Range work.
My process is base on a list, to do the dispatch i need to loop on a list
i want to filter a excel file to take only the line i want.
If there is “Siege” front of the column A so it needs to go in excel file 1
If there is Nothing front of the column A so it needs to go in excel file 2
This is the original file :
To filter my excel file i use a list :
This is what i want :
Excel file Siege :
Excel file without Siege :
Create 3 datatables: sourceDT, SiegeDT, NothingDT
- Read source file into datatable sourceDT
- Loop through datatable as datarows datatype
– If column index 1 has Siege, add row to SiegeDT
– Else column index 1 has Nothing, add row to NothingDT
- End Loop
- Write SiegeDT and NothingDT to the appropriate Excel files