title: OpenPyXL - How to delete rows from an Excel file based on some condition?
body: <p>I want to delete the rows from an excel file, knowing the values. I use openpyxl:</p>
  
  <p><code>key_values_list</code> is list with numbers (all are present in the excel file, on column)</p>
  
  <pre><code>   wb = load_workbook(src)
      sheet = wb['Sheet 1']
  
      for i in range(2, sheet.max_row + 1):
          if sheet.cell(row=i, column=1).value in key_values_list:
              sheet.delete_rows(i, 1)
      wb.save(src)
  </code></pre>
  
  <p>The code above doesn't delete all corresponding rows</p>