How to switch between sheets in excel openpyxl python to make changes -
import openpyxl wb = openpyxl.load_workbook('d:\excel.xlsx') wb.get_sheet_names()
after this, can see worksheets(85) excel file has. want go each sheet, edit data in 2-3 cells (which same sheets) , save file.
i new python , need help. thanks
in case see easiest probably
import openpyxl n = 0 wb = openpyxl.load_workbook('d:\excel.xlsx') sheets = wb.sheetnames ws = wb[sheets[n]]
where n sheetnumber (0 first). put in loop , increase n when want change sheet.
Comments
Post a Comment