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 / Order Excel column alp...
Power Automate
Answered

Order Excel column alphabetically in Power Automate Desktop

(0) ShareShare
ReportReport
Posted on by 14

I need to order a column in an Excel after initializing the program and creating an Excel Instance. Is there any possibility to do this in Power Automate Desktop?

 

Thanks for the answers!

I have the same question (0)
  • martinaKolafova Profile Picture
    29 on at

    Hello, you can create a macro (e.g., in another Excel file) that you can run using Power Automate Desktop, which will sort columns in all open sheets, or you can record in Power Automate Desktop pressing the relevant icon in the open Excel.

  • Verified answer
    VishnuReddy1997 Profile Picture
    2,666 Super User 2026 Season 1 on at

    Hi @AlbertML ,

     

    By using Run VBScript Action in PAD we can perform this.

     

    Steps:

    Open Run VBscript action in PAD and Copy this below code there and check.

     

    Code: 

    Set objExcel = CreateObject("Excel.Application")
    objExcel.Visible = True ' Set to True to see the Excel window (optional)
    Set objWorkbook = objExcel.Workbooks.Open("Path/To/Your/Workbook.xlsx") ' Replace with your file path
    Set sortRange = objWorkbook.Worksheets("Sheet1").Range("A:A") ' Replace "A:A" with your column range (e.g., "B:B")
    sortRange.Sort key:=sortRange, SortOn:=xlSortValues, Order:=xlAscending "if for descending use this Order:=xlDescending
    objWorkbook.Close SaveChanges:=False ' Set to True to save changes
    objExcel.Quit

     

    Note: If it works mark it as a solution,

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 474

#2
11manish Profile Picture

11manish 268

#3
David_MA Profile Picture

David_MA 243 Super User 2026 Season 1

Last 30 days Overall leaderboard