Skip to content
Advertisement

How to automatically display a specific range of columns on a spreadsheet created with xlsxwriter?

I would like to automatically display a specific range of columns when opening an excel spreadsheet created with xlsxwriter.

This is illustrated in the example below where the first row and column are frozen while the range of columns being displayed start at E and not at B (but note that I don’t want B:D to be hidden, I just want to start the range of column displayed at E)

Is this doable?

enter image description here

Advertisement

Answer

The XlsxWriter worksheet.freeze_panes() method has 2 optional parameters (top_row, left_column) which can be used to set the first cell in the non-frozen area. Like this:

JavaScript

Output:

enter image description here

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement