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 / Loop through Excel Row...
Power Automate
Answered

Loop through Excel Rows from Bottom to Top

(0) ShareShare
ReportReport
Posted on by 7

Loops normally progress from top to bottom through a range of rows in Excel.  In my case, I need to loop from bottom up through my rows.  This is because I have PAD deleting certain rows and once a row is deleted in Excel, the data moves up.  When the data moves up, the row that slides into the deleted row's place gets skipped.  I know how to do this in VBA, but any idea how to construct your loop to run from bottom to top in PAD?

 

Sudenga_Steve_0-1646421031392.png

 

I have the same question (0)
  • Verified answer
    Sudenga_Steve Profile Picture
    7 on at

    Folks, I was able to answer my own question.  It was as easy as setting the variable CurrentItem = CurrentItem - 1.

  • jen2023 Profile Picture
    2 on at

    Hi there @Sudenga_Steve - if you happen to read this, would you mind specifying what your final solution looked like? I am looking to achieve the exact same thing but still couldn't figure it out by myself. Thank you.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Instead of using a for each, I would use a loop, and then LoopIndex would be what row. You are analyzing. 

    get first free row

    Set variable %LoopMax% to %FirstFreeRow - 1%
    Loop %LoopMax% to 2 increment -1


    with this method you have created a for each from your last row back to row 2. And you can always reference the current row being worked on with %LoopIndex%

    good luck!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 598

#2
Valantis Profile Picture

Valantis 477

#3
Vish WR Profile Picture

Vish WR 370

Last 30 days Overall leaderboard