Keeping an Excel file clean improves the execution time of our bots. Also, some activities may fail or take longer than needed if entire rows are blank.
In this article, you will learn how to delete empty rows or lines from Excel worksheets using the Remove empty rows activity. The benefit of this action is that, for example, when the For each row activity is executed in a workflow, it does not take time to process blank rows unnecessarily.
Here’s how to manage empty rows in a few easy steps:
1. Read the Excel file with any of the following activities: Read Table, Read Excel File, Read Excel Range.
2. Use the Remove empty rows activity to remove empty rows.
3. Save the results of the previous step in a variable.
4. You can then save this variable back to a new Excel file or perform other activities on this data, like For each row.
- Each cell in a row is empty — it removes all rows with all empty cells.
- At least one cell in a row is empty — it removes all rows with at least one empty cell.
Find a downloadable project example below.