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 / Copy and paste from mu...
Power Automate
Unanswered

Copy and paste from multiple worksheets in to an excel table (keeps deleting data??)

(0) ShareShare
ReportReport
Posted on by 36

Hi all,

 

I'm having great difficulty and I'm hoping the Brains Trust can help me.

 

The task I'm trying to achieve, copy data from a 'new' spreadsheet (about 28 columns and 2.5k rows), then open up an 'existing' spreadsheet and paste the data, sounds simple right? Both workbooks have identical headers, so only the amount of rows may change. If the 'existing' workbook has more rows than the 'new' one, delete the 'existing' table of all rows (excluding headers), then paste the 'new' data in its place.

 

The problems I am hitting:

  1. If I use the delete rows function from cell A2 (leaving the header row) to FirstFreeRow it deletes all the rows, including the header and the table is no longer a table.
  2. If I use the Paste cells function from A2 to FirstFreeRow it works fine, but if existing worksheet had 50 more rows than the data that was pasted, then there are 50 additional rows of data (which will cause duplicates and corrupt the end results).
  3. If I try and be dodgy and tell it to paste an additional 100 rows to blank out potential additional data, it doesn't do it.
  4. If I use variables to define FirstFreeRow of the 'new' and the 'existing' and then tell it to delete cells starting from 'new' FirstFreeRow to 'existing' FirstFreeRow, for some reason it deletes all the rows, including the header and the table is no longer a table.

Essentially anything I try with Delete Cells is clearing all the data, including headers and removing the table.

 

I'm open to other ways to figure this out, so any suggestions you may have would be greatly appreciated.

 

I have the same question (0)
  • VJR Profile Picture
    7,635 on at

    @Weggs Please share the properties of the action that deletes the rows.

  • Verified answer
    Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    Hi @Weggs,

     

    Use Delete form Excel worksheet action:

    Kaif_Siddique_0-1673031184702.png

     

    To make it dynamic use Get first free column/row from Excel worksheet action.

     

    Hope this will help you.

     

    Regards

    Kaif

  • Weggs Profile Picture
    36 on at

    Hi VJR,

     

    Here is what I am using. As you can see I'm telling PAD to delete the cells from A2 - firstfreecolumn and row.

  • Weggs Profile Picture
    36 on at

    Ok, thats the wrong screen shot, thats a read one, I will post the proper screenshot in a moment

  • Weggs Profile Picture
    36 on at

    @Kaif_Siddique  The one thing in your screenshot that I had different, made the difference, I had 'Shift Direction' set to left, when I changed it to 'up' that stopped it from removing all the headers and removing the table, it also removed the additional rows that was in the existing worksheet (the new data had 10 less lines than the existing data as a test to ensure all additional lines were being removed).

     

    As far as I'm concerned, this is resolved. Thanks to you and @VJR I appreciate your help, thanks!

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard