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 can I use Power Au...
Power Automate
Unanswered

How can I use Power Automate Desktop flow to filter and select a specific option in Excel?"

(0) ShareShare
ReportReport
Posted on by 203

Hi Everyone,

 

How can I use Power Automate Desktop flow to filter and select a specific option in Excel?"

 

Best Regards 

Muzamil Ahmed

I have the same question (0)
  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Can you please provide more details as to what exactly you want to select?

  • Ahmedmuz Profile Picture
    203 on at

    Hi Aginus,

     

    I have an Excel sheet with data, and I want to apply a filter to it. In a specific column, I need to select certain data. For instance, in the attached screenshot, you can see the Excel data with a filter applied, and I am trying to select only the date "F1" from the "F" column.

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    You will need to use VBscript, PowerShell or similar scripting to do that. There are no native actions in PAD that can do this.

    The following script can do it for you if you put it in a Run VBscript action:

    Set Excel = CreateObject("Excel.Application")
    Set Workbook = Excel.Workbooks.Open("%ExcelFile%")
    Worksheets("%SheetName%").Range("%Range%").AutoFilter _
     Field:=2, _
     Criteria1:="F1"
    Workbook.Save
    Workbook.Close
    Excel.Quit

    Note: You will either need to provide literal values into the script for the variable placeholders, or set the variables appropriately before the Run VBscript action. The following variables are needed for this to work:

    • %ExcelFile% - the full path to your Excel file;
    • %SheetName% - the name of the sheet with the table. You could also do an index, like Worksheets(1) instead of using the name.
    • %Range% - the range of your table. From your screenshot, I can see it should be E1:H7, but I set it to be a variable, in case your table can be larger and then you need to get the first free row first and use that.

    The script will open Excel, apply the filter, save it and close it. So, you do not need to use Launch Excel or Close Excel in PAD itself. If you need to open Excel before or after the script, you can also do that, but make sure you close it appropriately. 

    -------------------------------------------------------------------------
    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.

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

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard