close

How to rename the sheet name in the spread-sheet using Python?

Hello Guys, How are you all? Hope You all Are Fine. Today We Are Going To learn about How to rename the sheet name in the spread-sheet using Python in Python. So Here I am Explain to you all the possible Methods here.

Without wasting your time, Let’s start This Article.

Table of Contents

How to rename the sheet name in the spread-sheet using Python?

  1. How to rename the sheet name in the spread-sheet using Python?

    You can do this by doing the following:
    import openpyxl ss=openpyxl.load_workbook("file.xlsx") #printing the sheet names ss_sheet = ss['Sheet'] ss_sheet.title = 'Fruit' ss.save("file.xlsx")

  2. rename the sheet name in the spread-sheet using Python

    You can do this by doing the following:
    import openpyxl ss=openpyxl.load_workbook("file.xlsx") #printing the sheet names ss_sheet = ss['Sheet'] ss_sheet.title = 'Fruit' ss.save("file.xlsx")

Method 1

You can do this by doing the following:

import openpyxl
ss=openpyxl.load_workbook("file.xlsx")
#printing the sheet names
ss_sheet = ss['Sheet']
ss_sheet.title = 'Fruit'
ss.save("file.xlsx")

This works for me. Hope this helps.

Summery

It’s all About this issue. Hope all Methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which Method worked for you? Thank You.

Also, Read