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 Delete the Rows...
Power Automate
Suggested Answer

How to Delete the Rows in Excel using the PAD

(0) ShareShare
ReportReport
Posted on by 203
Hi Team,
 
How to Delete the Rows in Excel using the PAD below are the steps 

Steps to Delete Rows After Filtering Data Without a Loop
1.Launch Excel and Open the File
2.Apply AutoFilter in Excel
3.Delete the Visible (Filtered) Rows
4.Remove FilterI need that power automate flow for this 
I have the same question (0)
  • Suggested answer
    eetuRobo Profile Picture
    4,204 Super User 2025 Season 2 on at

    After filtering you can use "Delete from Excel worksheet" to delete the cells that are filtered.



    Starting situation:


    After filtering:


    After deletion:



    EDIT:
    Since you said you wanted to delete the row and not just remove the cell value then I think that might not solve your issue.

    You can do the following instead to remove the rows entirely:
  • Ahmedmuz Profile Picture
    203 on at
    @eetuRobo Its is not working please give the right one.
  • eetuRobo Profile Picture
    4,204 Super User 2025 Season 2 on at
    @Ahmedmuz Please give more information than just "its not working".

    What is not working? What happens when you use the flow you have built? Does it give error or not delete the rows or does it delete wrong rows? Explain the issue

    Provide:
    -screenshots of what actions you have set up in your flow
    -possible errors
    -what is the result when your run the flow
    -what is the intended result
     
  • Ahmedmuz Profile Picture
    203 on at
    @eetuRobo As I clearly mentioned, it should delete the visible rows after filtering, not the ones containing "delete." In your third step, the text will be different each time.
  • Suggested answer
    VishnuReddy1997 Profile Picture
    2,656 Super User 2025 Season 2 on at
     
    You can achieve this by only 2 methods as of my knowledge.
     
    1. Try bulding macro.
    2. Use the below script to delete the Visible cells only after filetering in excel.
     
    ' Write a script to delete visible row data in an already opened excel. First row is header, do not delete it.
    ' 
    Dim objExcel, objWorkbook, objWorksheet
    Set objExcel = GetObject(, "Excel.Application")
    Set objWorkbook = objExcel.ActiveWorkbook
    Set objWorksheet = objWorkbook.ActiveSheet
    
    Dim lastRow, i
    lastRow = objWorksheet.Cells(objWorksheet.Rows.Count, 1).End(-4162).Row ' -4162 is xlUp
    
    For i = lastRow To 2 Step -1 ' Start from the last row to the second row (first row is header)
        If objWorksheet.Rows(i).EntireRow.Hidden = False Then
            objWorksheet.Rows(i).Delete
        End If
    Next
    
    'objWorkbook.Save
     
     
    (Note:- if you got your solution you can mark as solution and gives kudos)
     
    Thanks & Regards
    Vishnu Reddy
     
     

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