Skip to content Skip to sidebar Skip to footer

How Can I Loop Through And Increment The Rows In An Excel Workbook Formula In Python?

This is a continuation of the this question How can I iterate through excel files sheets and insert formula in Python? I decided to have it on new thread as its another issue. I'

Solution 1:

maybe you could just try formatting the string?

...
    row_count = 2
    for i, cellObj in enumerate(work_sheet['U'], 1):
        cellObj.value = f'=Q{row_count}-T{row_count}'
        work_book.save(os.path.join(out_folder, xlfile))
        row_count += 1

Post a Comment for "How Can I Loop Through And Increment The Rows In An Excel Workbook Formula In Python?"