title: Openpyxl: can't seem to get the syntax right for what I'm trying to do (read next cell down)
body: <p>Here's the code I have. I'm simply trying to open a spreadsheet (which currently only has information in the first column), and read the first cell, print the information, then later along the lines loop back up to the top and read the next cell down. What am I doing wrong?</p>
  
  <pre><code>import openpyxl
  
  wb = openpyxl.load_workbook('students2.xlsx')
  
  ws = wb.active
  
  PrintNext = True #Starts my while statement
  while True :
  
      for i in range(1,300):        #I think this is where I'm having an issue?
          for j in range(1,2):
              StudentID = ws.cell(row=i+1, column=j).value
  
      print(StudentID)
      PrintNext = False        #This gets it to move on from my while
      pass
  
  PrintNext = True       #This is to get it to go back to my while
  print(StudentID)       #This is to test that it has the next cell down
  </code></pre>
  
  <p>I found the solution with the help of the answer here, but I found a much better solution over-all.</p>
  
  <p>Set these to variables:</p>
  
  <pre><code>for i in range(RowX,RowY):
      for j in range(ColX,ColY):
          StudentID = ws.cell(row=i+1, column=j).value
  </code></pre>
  
  <p>So that any changes you make ("RowX = RowX + 1", for example) are reflected the next time you update the "for" statement!</p>