python xlsxwriter change row height for all rows in the sheet
Asked Answered
W

1

20

Python xlsxwriter, change row height for all rows in the sheet, following is available but apply to single row

worksheet.set_row(0, 20)  # Set the height of Row 1 to 20.

Want to change height of all the rows sheet.

Wasserman answered 19/3, 2016 at 10:34 Comment(0)
G
36

To set the height of all rows in XlsxWriter, efficiently*, you can use the set_default_row() method:

worksheet.set_default_row(20)

(*) This is efficient because it uses an Excel optimisation to adjust the row heights with a single XML element. By contrast, using set_row() for each of the ~ 1 million rows would required 1 million XML elements and would lead to a very large file.

Goodwill answered 19/3, 2016 at 11:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.