Skip to main content

Notifications

Power Automate - Power Automate Desktop
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.
 
Categories:
  • Suggested answer
    eetuRobo Profile Picture
    eetuRobo 2,574 on at
    how to use Power Automate to delete filtered rows in Excel
    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.

     

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

End of Year Newsletter…

End of Year Community Newsletter…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #11 New Opportunities…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,609

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,420

Leaderboard