i have an excel sheet and i need to filter column D with “2” then delete all the filtered rows
To filter column D with the value “2” and delete the filtered rows in UiPath, you can follow these steps:
- Use the “Excel Application Scope” activity to open the Excel file.
- Within the scope, use the “Read Range” activity to read the data from the Excel sheet into a DataTable variable, let’s say
dtData
. - Use the “Filter Data Table” activity to filter the DataTable based on the condition in column D. Set the filter condition to
"[ColumnD] = '2'"
(assuming the column name is “ColumnD”). - The filtered DataTable will be stored in a new DataTable variable, let’s say
dtFiltered
. - Use the “For Each Row” activity to iterate through each row in
dtFiltered
. - Inside the loop, use the “Delete Row” activity to delete the current row from
dtData
. - After the loop completes, use the “Write Range” activity to write the updated
dtData
back to the Excel file, overwriting the previous data.
Thanks!!
Welcome to the community
Use filter excel activity and then use delete rows activity
Cheers