Openpyxl Write Data to Cell | Openpyxl Write to Cell




  • We can add data to the excel file using the following Python code.
  • We will import the load_workbook function from the openpyxl module, then create the object of the file and pass file nameas an argument.
 Write Data to Cell

Write Data to Cell

Sample Code

from openpyxl import load_workbook
wb = load_workbook(r'Wikitechy.xlsx')  

sheet = wb.active
sheet['A1'] = 'Wikitechy'  

sheet.cell(row=2, column=2).value = 10  
wb.save(r'Wikitechy.xlsx')  

Read Also

Output




Related Searches to Openpyxl Write Data to Cell | Openpyxl Write to Cell

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add wikitechy.com to your ad blocking whitelist or disable your adblocking software.

×