1.I have a master excel file for which I read the range and store as dt_datatable1.
2.Then I filter on a certain column “age” on ‘is not empty’. I store this as dt_datatable2
3.Then I perform certain actions on dt_datatable2 (filling in some columns).
4.Then I want to write everything back in the master excel file
I’m stuck at the 4th step. I want to write the dt_datatable1+the data of dt_datatable2 with the data that I just had enriched in step 3. So the data in dt_datatable1 needs to be overwritten for the ones that were in scope of my filter for dt_datatable2.
Thank you for your reply. I have tried that, but then the lines of datatable2 get added. So eventually I have the data twice (the original one that was already included in datatable1 + the data I added from datatable2).
1 - Read Master Excel “Sheet1” - store in dt_datatable1
2 - you apply a filter - dt_datatable2 get the data of dt_datatable1 column “age” on ‘is not empty
3 - you perform certain actions on dt_datatable2 (filling in some columns). dt_datatable2 = this “filling in some columns”
4 - You can write the dt_datatable2 in your Master Excel , but “Sheet2”.
Only step 4 is not correct. I need to write the dt_datatable1 which I did not perform any actions on + dt_datatable2, in the same order as they already were, in the same excel sheet as I got the info in the first place.
@Vivek_Arunagiri, thanks for your reply.
Well, I think I do need the datatable2 because:
So, allow me to tell you the high level process.
I have an excel file which gets new data every day (appended).
For these new rows, I need to check whether the project number already existed in a previous row.
So, this is what I do:
I store the complete excel file as datatable1
I store the new ones that are appended as datatable2 and get row item for project number (=var_projectnumber)
For each row in datatable2 I check if the project number already exists by filtering the datatable1 on the var_projectnumber. If then datatable2.count.tostring >0 then it already exists and for that row I assign the value of a certain column as “project already exists”.
after this, I want to put everything back in excel (= datatable1 and datatable 2, in the same order as they already existed)
So you’ll write the dt_datatable1 in the same sheet1, and after you’ll write the dt_datatable2 in the same sheet1, but in Write range activitie you set this way Range = “A:” + dt_datatable1.rows.count + 1