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 / How to Loop in excel f...
Power Automate
Answered

How to Loop in excel for each a range rows

(0) ShareShare
ReportReport
Posted on by 19

Good Day Experts

I have a question how to look through excel file for every 10 row .

Example i have an excel file with 2000 row and need to upload every 200 row separate till reaching the 1st empty row.

I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @Mona_Sultan,


    Here is my sample code of flow.

    It will separate every 200 rows copied from original 2000 rows, and will save 10 files as a result.

     

    Excel.LaunchAndOpen Path: $'''C:\\Users\\UserName\\Downloads\\2000 rows.xlsx''' Visible: True ReadOnly: True LoadAddInsAndMacros: False Instance=> ExcelInstance2000
    LOOP MyLoopIndex FROM 1 TO 10 STEP 1
     SET StartNum TO (MyLoopIndex - 1) * 200 + 1
     SET EndNum TO (MyLoopIndex - 1) * 200 + 200
     Excel.ReadCells Instance: ExcelInstance2000 StartColumn: 1 StartRow: StartNum EndColumn: 1 EndRow: EndNum ReadAsText: False FirstLineIsHeader: False RangeValue=> ExcelData
     Excel.Launch Visible: True LoadAddInsAndMacros: False Instance=> ExcelInstanceNew
     Excel.WriteCell Instance: ExcelInstanceNew Value: ExcelData Column: 1 Row: 1
     Excel.CloseAndSaveAs Instance: ExcelInstanceNew DocumentFormat: Excel.ExcelFormat.FromExtension DocumentPath: $'''C:\\Users\\UserName\\Downloads\\%StartNum%-%EndNum%.xlsx'''
    END
    Excel.Close Instance: ExcelInstance2000

     

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Build this in an Excel VBA Macro.  Then the bot can 1) Open Excel and 2) run Macro.  It will be much faster than trying to use PAD.  @Anonymous 's logic will work, I just recommend building it in Excel.

  • Mona_Sultan Profile Picture
    19 on at

    Dear Shindomo

     

    Thank you so much it worked

  • Mona_Sultan Profile Picture
    19 on at

    Dear Michael

     

    Thanks i will check this 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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 252 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard