-1

I have an excel sheet with specific formatting done. I need to copy this sheet to another workbook(excel sheet) without loosing the formatting(colour combination, wrap texting, cell size etc.) using python

1 Answers1

0

Copying just the data is easy enough> Formatting & styles are part of the workbook, to maintain these need to be copied as well. You don't say if the 'another workbook' is existing or you want to copy the sheet to a newly created workbook. If the later then making copies of the workbook with a new name is probably easier even if it contains extra sheets you need to delete. If the later look at the discussion in the following link has options in Solution 2 and 3 which use pywin32 and xlwings respectively. How to copy over an Excel sheet to another workbook in Python

[pywin32] [xlwings]

moken
  • 3,227
  • 8
  • 13
  • 23