Copy whole worksheet with openpyxl

前端 未结 3 1151
挽巷
挽巷 2020-11-28 12:54

Please can someone give me an example, how to copy a whole worksheet with styles (from rows and columns) to a second worksheet in the same workbook ? (in a

3条回答
  •  有刺的猬
    2020-11-28 13:36

    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

提交回复
热议问题