IRONSOFTWAREHOME
Copy Excel Worksheets
from ironxl import *

# Load the first Excel workbook
first_book = WorkBook.Load("sample.xlsx")
second_book = WorkBook.Create()

# Select the first worksheet in the workbook
worksheet = first_book.DefaultWorkSheet

# Duplicate the worksheet to the same workbook
worksheet.CopySheet("Copied Sheet")

# Duplicate the worksheet to another workbook with the specified name
worksheet.CopyTo(second_book, "Copied Sheet")

# Save changes in the first workbook
first_book.Save()

# Save the second workbook with the copied worksheet
second_book.SaveAs("copyExcelWorksheet.xlsx")
pip install ironxl
Copy Excel Worksheets

Copy Excel Worksheets

The code example above shows how to use IronXL for Python to duplicate and copy WorkSheet objects within and between Excel WorkBook objects. You can copy sheets to and from other workbooks, or create duplicate sheets within the same workbook.

The CopySheet method duplicates a worksheet within the same workbook. The name for the new worksheet is required as a parameter.

Use the CopyTo method to copy a sheet to another workbook. A WorkBook object is required as the first parameter, followed by the name for the new worksheet.

How to Copy Excel Worksheets in Python

  1. Install IronXL for Python to copy Excel worksheets.
  2. Load an Excel workbook and create a new sheet.
  3. Use the CopyTo method to copy data to the new worksheet.
  4. Save the new Excel worksheet.
Explore how to copy Excel worksheets using Python with IronXL.

Ready to Get Started?

Version:2026.9just released

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required