title: How do I determine whether an Excel worksheet contains no values using openpyxl?
body: <p>I'm coding a Python 3.7.2 script to check for unused worksheets in an Excel file, and I need a way to determine if the current worksheet contains no values. Previously when I coded in VBA, I would find the last-used-row and last-used-column to check if the sheet was 'empty', but the max_column and max_row functions in openpyxl take into account non-value data like formatting which I want to ignore. Is there any way to check if none of the cells of a given worksheet contain any values?</p>
  
  <p>Previously when I coded in VBA, I would find the last-used-row and last-used-column to check if the sheet was 'empty', but the max_column and max_row functions in openpyxl take into account non-value data like formatting which I want to ignore.</p>
  
  <p>Ideally I'd be able to find a way to get the last_used_column and last_used_row like I used to in VBA, but I'd appreciate it if anyone could tell me of any tools I could use to build a simple function where you pass it a worksheet and it spits out True or False depending on whether it has no values or not.</p>