import openpyxl
#freeze and unfreeze using openpyxl
#open zomato spreadsheet
work_book=openpyxl.load_workbook(r'C:\Users\allso\Desktop\new vba projects\openpyxl\zomato.xlsx')
#select active sheet
sheet=work_book.active
#freeze the top row
#all rows above the current row and all columns left to the current column will be frozen
sheet.freeze_panes="A2"
#save the work book
work_book.save(r'C:\Users\allso\Desktop\new vba projects\openpyxl\zomato.xlsx')
Showing posts with label Freeze top row using Openpyxl. Show all posts
Showing posts with label Freeze top row using Openpyxl. Show all posts
Saturday, June 10, 2023
Freeze top row using Openpyxl
Subscribe to:
Posts (Atom)