Copy whole worksheet with openpyxl

Version 2.4 will allow you to do this: copy_worksheet

>>> source = wb.active
>>> target = wb.copy_worksheet(source)

For older ones you can probably copy the source code from here

UPDATE: You can’t simply graft this code into older versions of the library

Leave a Comment