How to loop through an excel using for each or loop condition and delete excel rows based on some column value .
You can use the Find and replace cells in Excel worksheet action to find the column and row indexes for a cell where a match was found.
-------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.
I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.
Is there any other option for getting the row number of an excel if a particular value is found?
Thanks this is helpful !!
Hi,
You can use counter variable before loop to keep track of row number to be deleted and increment it in loop. Please find below screenshot to delete row based on certain column value: in below screenshot Fruit is highlighted which is column name mentioned in "" i.e. "Fruit" and Orange is value mentioned for that column to delete that row. In delete action I added +2, as first row is taken as header in read from Excel worksheet action and row index starts with 0 so to delete exact row, added +2 in row counter.
Please mark this as solution if it helps you solve issue. Happy to help you more. 🙂
On which column based you need to delete rows write that condition in if activity and then use delete rows activity
Hello,
Thank you for your response. I used the same logic, however I am unsure as to what to mention in row number for delete rows if using for each loop and datatable.
First use launch excel activity and then read excel work sheet
Then use for each and give input as the datatable which you get from read excel sheet activity and loop through it
Take if condition and writte condition as below
Currentitem[columnname] = your value
In first operand of if activity
Then select equal to in drop down
And write
True in the second operand
Then inside if activity use delete rows from excel or delete row from data table activities as per your requirement
Hope this helps
Usha
eetuRobo
4
Super User 2025 Season 1
KO-05050229-0
2
stampcoin
2