Copy whole worksheet with openpyxl

前端 未结 3 1162
挽巷
挽巷 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:30

    I had the same problem. I solved using copy instead deepcopy. I found the solution on this site

    I hope this works for you!

    0 讨论(0)
  • 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

    0 讨论(0)
  • 2020-11-28 13:43

    You can't do this easily. The best approach is probably the one described in bug 171

    0 讨论(0)
提交回复
热议问题