from openpyxl import Workbook, load_workbook
wb=load_workbook("C:\\xx\\ISWPR_REP3_NOV04.xlsx")
ws=wb.active
ws.row_dimensions.group(1,22, hidden=True)
for i in range(24,98) :
    if '-TR' not in ws['d'+str(i)].value :
        ws.row_dimensions.group(i, hidden=True)
wb.save("C:\\xx\\xx.xlsx")

标签: none

添加新评论