Skip to main content
Community site session details

Community site session details

Session Id : 5ebPIlVRhFChJz/2LZABCP
Power Automate - Power Automate Desktop
Answered

copy an entire Excel sheet including all its data,into a new sheet within the same workbook using power automate desktop

Like (0) ShareShare
ReportReport
Posted on 7 Feb 2024 00:44:03 by 24

Hello Everyone,

 

I hope you're all doing well! I'm currently working on a project in Excel and I'm facing a challenge. I want to duplicate/copy an entire Excel sheet, including all its data, into a new sheet within the same workbook using power automate desktop. I want to create multiple copies of the sheet for analysis purposes.

 

I've tried a few things, but I'm not getting the desired results. Could someone please provide me  any other method to accomplish this task efficiently?

Your assistance would be greatly appreciated! Thank you in advance.

 

Best regards,

Suraj

 
 
 
  • Suraj_Adhikari Profile Picture
    24 on 26 Feb 2024 at 02:03:14
    Re: copy an entire Excel sheet including all its data,into a new sheet within the same workbook using power automate desktop

    Sorry for late response.

    Thank you it work. Thank you so much.

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on 07 Feb 2024 at 06:15:16
    Re: copy an entire Excel sheet including all its data,into a new sheet within the same workbook using power automate desktop

    What exactly doesn't work? What happens when you try it? Can you share some screenshots of what you did and the results?

  • Suraj_Adhikari Profile Picture
    24 on 07 Feb 2024 at 06:13:50
    Re: copy an entire Excel sheet including all its data,into a new sheet within the same workbook using power automate desktop

    Hello @Agnius 

    I tried but it does not work for me.

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on 07 Feb 2024 at 05:38:07
    Re: copy an entire Excel sheet including all its data,into a new sheet within the same workbook using power automate desktop

    Have you tried the VBScript that @WillSG suggested. It does exactly what you want to do. You just need to pass in some parameters into the script based on your actual file, such as the file name and the sheet name.

  • Suraj_Adhikari Profile Picture
    24 on 07 Feb 2024 at 05:35:25
    Re: copy an entire Excel sheet including all its data,into a new sheet within the same workbook using power automate desktop

    Hello. @WillSG I hope you are doing well.

    Thank you for your kind assist.

    let me explain what i am trying to do. My english is not that much good. Please bear with my english.

     I have 2 excel file one is filled with required data and another one is following format excel file.

      where i write the data of first excel file.

    スクリーンショット (7).png

     

    After fill the all required filled in above excel, i want to create a copy of that sheet with the name of company name as new sheet name. I want to repeat this task multiple time.

    i tried all the possible way, it copy only excel data that is filled in the above excel file. i want to copy all data including format also which is i am unable to do.

     

    Your assistance would be greatly appreciated! Thank you in advance.

     

    Best regards,

    Suraj

     

     

  • Verified answer
    WillSG Profile Picture
    352 Moderator on 07 Feb 2024 at 04:00:24
    Re: copy an entire Excel sheet including all its data,into a new sheet within the same workbook using power automate desktop

    Hi @Suraj_Adhikari  I hope you are doing well.

     

    You can use the Action “Run VBScript” and run a Visual Basic Script as shown here below:


    ' Create an instance of Excel application

    Set objExcel = GetObject(, "Excel.Application")

     

    ' Get the workbook named "Book1.xlsx"

    Set objWorkbook = objExcel.Workbooks("Book1.xlsx")

     

    ' Get the worksheet named "Sheet1"

    Set objWorksheet = objWorkbook.Worksheets("Sheet1")

     

    ' Create N copies of the worksheet

    For i = 1 To %UserInput%

        objWorksheet.Copy , objWorksheet

    Next

     

    ' Clean up the objects

    Set objWorksheet = Nothing

    Set objWorkbook = Nothing

    Set objExcel = Nothing

     

    The variable name %UserInput% is created in action #2. The Input Dialog Action can be use in this way to define how many copies do you need, see image below.

     

    In this example I’m testing with an Excel File named Book1 and a tab named Sheet1, if the file name and tab name will change, you can adjust accordingly and use Variables instead.

     

    Hope this helps,


    If I have addressed your inquiry successfully, kindly consider marking my response as the preferred solution. If you found my assistance helpful, a 'Thumbs Up' would be greatly appreciated.

     

    Additionally, if you have any questions, feel free to DM me, and we can initiate a discussion.

     

    Kind regards,

     

    Will SG

    Managing Director & Automation Lead

    RAMS CR (Recruitment & Automation)

    LinkedIn Profile

     

    WillSG_Screenshot 2024-02-06 215124.png

  • Suraj_Adhikari Profile Picture
    24 on 07 Feb 2024 at 03:12:01
    Re: copy an entire Excel sheet including all its data,into a new sheet within the same workbook using power automate desktop

    @SeanLin Thank you i  will try 

  • SeanLin Profile Picture
    55 on 07 Feb 2024 at 02:12:40
    Re: copy an entire Excel sheet including all its data,into a new sheet within the same workbook using power automate desktop

    Although there is no direct way to do that, you can calculate the first free row and column then copy the data from the source worksheet to the new worksheet you want.

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Loading complete