line 13 of your code is
sheet["CE"] = "vl"
import json from collections import namedtuple from openpyxl import Workbook from openpyxl.utils import column_index_from_string Cell = namedtuple('Cell', 'row column value') def search_for_value(data, lookup_value): for row, values in data.items(): for column, cell_value in values.items(): if cell_value == lookup_value: yield Cell(row, column, cell_value) num = 50 OFFSET = 5 spam = "your JSON string here" data = json.loads(spam) for cell in search_for_value(data, num): print(cell) ws.cell(row=int(cell.row), column=column_index_from_string(cell.column)+OFFSET, value=cell.value) wb.save(filename="aexa_append.xlsx")
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs