How to remove row?

Hi, I want to remove useless row . In the file , I want to remove everything blow row 5.
Please help me resolve this problem. Thank you!

test.xlsx (22.6 KB)

If the unnecessary rows start from the 5th row always then use a “Select Range” activity to select A6 cell and then pass CTRL+Down using Send Hotkey. Pass Delete using Send Hotkey again to delete it. Click on Save icon at the top using Click activity(this might not be required but it ensures that the file is saved).

Read the entire table into datatable using excel application scope and read range,

use a if condition inside for each row and check for the index of the row and if index is greater than 4, use remove data row activity and delete the row.

Let us know if this helps.
Pavan H

Thanks for your help, I think it will helps. But how to write the condition?
I set the length as a variable.


can you please check this file. I have created workflow based on your requirement.
Remove (31.1 KB)


1 Like

Hi @guowq
See If you want to delete specific row then simply read range and take Remove Data Row activity and just specify datatable variable and row index of that row(e.g. 5),
But from my understanding I think you want to delete rows from row 5, then instead of remove data row you need to use Filter data table activity and specify your column (“Description” = “”) and check for Remove radio button.
So by this it’ll check for null value in description column and if it is null then it’ll remove that row from datatable.

I hope this will help you. :slight_smile:

@Arunachalam Thanks for your helping, my problem has been solved. Your method is easy to understand.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.