on-internet
← Community

How to rename sheet and add value to the name in xlwings

Stack Overflow ·

I have a list of sheets and for each sheet I need to SUM float values from the column A and the SUM outcome should be added to the sheet name. For example: Sheet1 --> Sheet1 (123). import xlwings as xw wb = xw.Book(filepath) sheet_names = wb.sheets for x in sheet_names: # missing summary calculation here wb.sheets[x].name = wb.sheets[x] + str('123') # '123' should be the # outcome of the SUM so str(SUM) wb.save() wb.close() xw.App().quit()

Comments

Sign in or sign up to comment and upvote.

No comments yet.