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

Notifications

Announcements

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,204 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard