web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / how to use Power Autom...
Power Automate
Suggested Answer

how to use Power Automate to delete filtered rows in Excel

(0) ShareShare
ReportReport
Posted on by 6
After filtering the data that needs to be deleted, I want to delete these rows. Could you please advise on how to set the appropriate variables for row deletion?
 
The Microsoft learning hints state, "The index number of the row to be deleted. Numbering starts from 1." However, I find it challenging to set this because of the filtered data.
 
I have the same question (0)
  • Suggested answer
    eetuRobo Profile Picture
    4,478 Super User 2026 Season 1 on at
    If you are only filtering the data to delete it I would not use filter at all. I would just find the rows I want to delete and loop and delete them.
     
    Like so:
    Use Find and replace cells in Excel worksheet
     



    That produces Cells Table like so:
     



    Then Sort data tables RowIndex -column to decending so the table looks like this:
     


     
    We sort it to be decending so that when you delete the row in excel it deletes from top to bottom. If you would first delete rowIndex 2 then the 5th row index would become 4 and so on. So that’s why we sort it to decending.

    Then use For each to loop the Cells table and delete those rows.

     
  • jblackcitrin Profile Picture
    6 on at
    eetuRobo's solution worked really well for me - very appreciative of this writeup!
     
    I used the concept to to do the opposite - remove rows NOT on my list. To accomplish this, I used an inner join of all rows and the data I want to keep then filtered the list to remove the rows I want to keep.
     
    This allowed me to use Power Automate Desktop to split up a table to separate sheets based on unique values in a column while preserving formatting (conditional formatting & data validation)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 308

#2
David_MA Profile Picture

David_MA 256 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 226 Most Valuable Professional

Last 30 days Overall leaderboard