Answers for "write value to cell openpyxl"

1

openpyxl write in cell

import openpyxl
wb = load_workbook(filename='xxxx.xlsx')
ws = wb.worksheets[0]
ws['A1'] = 1
ws.cell(row=2, column=2).value = 2
ws.cell(coordinate="C3").value = 3  # 'coordinate=' is optional here
Posted by: Guest on May-31-2021
0

openpyxl read cell value

from openpyxl import load_workbook

wb = load_workbook("file.xlsx", data_only=True)
sh = wb["Sheet_name"]
print(sh["x10"].value)
Posted by: Guest on June-10-2021

Code answers related to "write value to cell openpyxl"

Python Answers by Framework

Browse Popular Code Answers by Language