title: Iterate over Worksheets, Rows, Columns
body: <p>I want to print all data (all rows) of a specific column in python using <code>openpyxl</code> I am working in this way;</p>
  
  <pre><code>from openpyxl import load_workbook
  workbook = load_workbook('----------/dataset.xlsx')
  sheet = workbook.active  
  for i in sheet:
     print(sheet.cell(row=i, column=2).value)
  </code></pre>
  
  <p>But it gives </p>
  
  <blockquote>
    <p>if row &lt; 1 or column &lt; 1:
    TypeError: unorderable types: tuple() &lt; int()</p>
  </blockquote>
  
  <p>Because i am iterating in <code>row=i</code>. If I use <code>sheet.cell(row=4, column=2).value</code> it print the value of cell. But how can I iterate over all document?</p>
  
  <p><strong>Edit 1</strong></p>
  
  <p>On some research, it is found that data can be get using Sheet Name. The <code>Sheet 1</code> exists in the <code>.xlsx</code> file but its data is not printing. Any problem in this code? </p>
  
  <pre><code>workbook = load_workbook('---------------/dataset.xlsx')
  print(workbook.get_sheet_names())
  worksheet =workbook.get_sheet_by_name('Sheet1')
  c=2
  for i in worksheet: 
      d = worksheet.cell(row=c, column=2)
      if(d.value is None):
          return
      else:
          print(d.value)
      c=c+1
  </code></pre>