Hi, I want to delete all rows in an Excel table where the column “Status” has the value “complete”.
What I did:
- Read the Excel
- Copy datatable
- For each row in copied datatable delete in original datatable
→ Here I get the error “The given DataRow is not in the current DataRowCollection”
- Write down original datatable
what about using FilterDataTable activity?
You can use Filter dataTable activity and pass dataTable as input coming from Read Range activity and put condition like
“ColumnName” equals “Complete”
And also click radio button remove and this activity will give you output as dataTable.
Then use Write Range activity to write into Excel file.
Remove_Row.zip (20.9 KB)
Hope This would help
Ashley Nihal Dcunha
@lakshman How can I replace the complete Excel? Now it only overwrites the first rows as the new list is shorter. Is there still no option to replace a table? I now use the workaround to copy the blank lines as well.
@ashley11 thanks for the example
Use Write Cell activity before write range activity and specify below.
Range: “A1:D100” (use range according to your data)
Value: " "
The above activity will write empty values all over Excel file. Then it write filtered data using Write Range activity.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.