How search data in excel with openpyxl

0 votes


import openpyxl
wb ='the path to the file') = 1
ws =

for row in ws.iter_rows('B4:F4'):
for cell in row:
if cell.value == "Maria":
print(ws.cell(row=cell.row, column=2).value)

Mistake: for row in range(min_row, max_row + 1):

TypeError: 'str' object cannot be interpreted as an integer

Excel table

I need to search "Pavel" and print it in the console

Where is the mistake?