Openpyxl Worksheet



  • As we all know that every workbook can have multiple sheets.
  • We’d like to create more than one sheet during a single workbook then we will access those excel sheets using Python
 Openpyxl Sheet

Openpyxl Sheets

Sample Code

import openpyxl
wb = openpyxl.load_workbook('dimension_1.xlsx')  

#Getting list of all sheet available in workbook  
print(wb.get_sheet_names())  

# Returning object  
active_sheet = wb.active
print(type(active_sheet))  

# Title of sheet  
sheet = wb.get_sheet_by_name("Monday")  
print(sheet.title)  

Output

['Sheet', 'HTML', 'CSS', 'PHP', 'PYTHON']
<class 'openpyxl.worksheet.worksheet.Worksheet'>
HTML


Related Searches to Openpyxl Worksheet