Excel - Remove rows with color

Hello dear RPA developers,

I’m actually trying to remove entire rows from an Excel data table when there is a color (on the same row) but I struggle doing so as you may guess !
Hopefully we know where to check for the color.

I made a test sequence but here is the result:
We have two Excel files there, and on the right is the one which is supposed to have the rows 2, 6 and 8 removed. But only the rows 4 and 8 (could be 8 or 9 or 10 or 11) are gone.

In a For each we have the following activities to add to a collection the rows where a color is spotted:
for each color

and later an other for each to remove this collection of rows:
for each item
I tried with an array od data row but I was not able to find a good rowindex so I switched to an array of int32.

As you can see, the right numbers of colored rows is detected and deleted

So, if someone have an idea on how to resolve this, he is more than welcome to share them :slight_smile:

Thanks for reading and have a great day.

Hi @Geoffroy_Pantegnies

We need to decrease index value by 2 after every deletion of row that is the error

Hope it solves your issue


Hi @Robinnavinraj_S and thank you for your feedback, much appreciated !

Following your idea, I tried with RowIndex: item-2 and it worked !

Thanks for your time & have a nice day.

1 Like

Great happy to hear this @Geoffroy_Pantegnies

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