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 / Excel - Copy data from...
Power Automate
Unanswered

Excel - Copy data from one workbook to another

(0) ShareShare
ReportReport
Posted on by 2

I am new to PAD.

 

I have an Excel workbook with multiple rows and columns.  Column A is the unique ID for each row.  Some rows have the same unique ID with different data in the following columns.  I am trying to copy all the row data from the primary workbook, where the unique ID is the same, to a new workbook and save the file with the unique ID as the file name.

 

Any help is appreciated.

I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,136 Super User 2026 Season 1 on at

    Hi @mocho 

     

    For the answer to ur question, try the below approach

     

     For answering your question, i had made a sample excel file having 2 column : ID, Country

     

    Excel file used for demo: Data.xlsxExcel file used for demo: Data.xlsx

     

    Using the above file Data.xlsx, I had build a flow which spilt the Data.xlsx file data into sub files considering the ID column as unique value 

     

    Flow screenshot

     

    Flow Part 1Flow Part 1Flow Part 2Flow Part 2Flow Part 3Flow Part 3

     

     

    Logic behind this flow:

     

    1. First step is to read the master excel file, here Data.xlsx, for that i had used launch excel and then read the excel using Read from worksheet

     

    image.pngimage.png

    Here the %FirstFreeColumn - 1% & %FirstFreeRow - 1% are taken using the action get first free row/column action

    [see that in main flow screenshot]

     

     

    2. After reading the excel file and storing in a variable, next step is to retrive the unique ID column value , this is done by using 2 steps, first retriving the column values as list and then removing the duplicates as shown in below screenshots

     

    image.png

     

     

    Next Step is to loop through each unique value in the list which has the id values, for that we are using for each loop

     

    within the for each loop, we are doing the below sub steps:

                     a. Launch an excel opening a blank document [ for the new excel which we are going to create for storing the respective ID data]

    image.png


                     b.  Adding headers to new excel using write to cells [ the master excel sheet headers]

    Nived_Nambiar_1-1655046776574.png

     

                     c.  Setting a integer variable i with value as 2 [ this is done writing values to cells in new excel document]

      

    Nived_Nambiar_2-1655046870256.png

     

                      d.   Next is , we are looping through each row in master excel sheet and and then checking if the first column value is equal to the unique value from list in the current iteration using if action, if so then use write to cell action for writing the data to new sheet and then increasing the i value by 1

     

    Nived_Nambiar_3-1655046988286.png

     

     

                      e.  Next is after writing all the unique value data in that excel, next is to save that excel with the unqiue id as filename and close it 

    Nived_Nambiar_4-1655047090393.png

     

     

     

     

                       f. Last step is to close the master excel file as well 

    Nived_Nambiar_5-1655047128035.png

     

     

    The final result looks like below:

     

    Nived_Nambiar_6-1655047156706.png

     

     

    Hope the steps are clear, let me know if you had any questions

     

    If this helps you in solving ur query kindly mark it as solution

     

     

    Thanks & Regards,

    Nived N

     

     

     

      

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 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard