title: Python: Check if value exists in Excel file. Help specifying row number
body: <p>Following the response in <a href="https://stackoverflow.com/questions/30678721/find-if-a-value-exists-in-a-column-in-excel-using-python">this </a>thread. I prepared the following code.</p>
  
  <pre><code>from xlrd import open_workbook
  
  def main(): 
    book = open_workbook('/dir/file.xlsx', index_col=0) 
    sheet = 'Sheet1' 
    collection_year_col = 'Unnamed: 2' 
    test_year = 2011 
    for row in range(sheet.nrows=7): 
        if sheet.cell(row,collection_year_col).value == test_year: 
           runCode() 
  
  def runCode():
      print("worked!")
  </code></pre>
  
  <p>It runs and gives no error, but never outputs the <code>print()</code>. </p>
  
  <p>Why is that and how can I fix it? My value of interest is "2011" and is found in cell C7 of my Excel file.</p>
  
  <p>I suspect the issue is my (bad?) syntax to refer to row 7. </p>