title: PHPExcel - Finding First Column With blank cell
body: <p>Trying to locate the first blank cell in a column. The idea is to pick a column that I know has to have a value (in this case, JOB_NUMBER) and scan through it until a blank cell is found. The code below, in my mind, should do that. However, it never stops. I imagine it is stuck in the <code>while</code> loop, but I don't understand why.</p>
  <p>Code:</p>
  <pre><code>&lt;?php 
  require('./Classes/PHPExcel/IOFactory.php');
  
  ini_set('max_execution_time', 800);
  ini_set('memory_limit', 2000000000);  
  
  $inputFileType = 'Excel2007';
  $inputFileName = $_FILES['file']['tmp_name'];
  
  class MyReadFilter implements PHPExcel_Reader_IReadFilter {
  
      public function __construct($fromColumn, $toColumn) {
          $this-&gt;columns = array();
          $toColumn++;
          while ($fromColumn !== $toColumn) {
          $this-&gt;columns[] = $fromColumn++;
          }
      }
  
      public function readCell($column, $row, $worksheetName = '') {
            // Read columns from 'A' to 'AF'
            if (in_array($column, $this-&gt;columns)) {
                return true;
            }
            return false;
        }
  }
  
  $filterSubset = new MyReadFilter('A', 'AF'); 
  
  $objReader = PHPExcel_IOFactory::createReader($inputFileType);
  
  $objReader-&gt;setReadFilter($filterSubset); 
  $objReader-&gt;setLoadSheetsOnly( array(&quot;NORTH&quot;) );
  $objPHPExcelReader = $objReader-&gt;load($inputFileName);
  
  $r = 3500;
  while(isset($maxrow_north) != 1){
      $cellvalue = $objPHPExcelReader-&gt;getSheetByName('NORTH')-&gt;getCellByColumnAndRow(2, $r);
  
      if(isset($cellvalue) != 1){
          $maxrow_north = $r; 
      } elseif($r &gt; 4000) {
          echo &quot;It's over 4000!&quot;;
      } else {
          $r = $r++;
          } 
  }
  
  
  echo $maxrow_north;
  ?&gt;
  </code></pre>
  <p><strong>Some more background</strong></p>
  <p>I am having admins upload <code>.xlsx</code> <code>.xls</code> or <code>.csv</code> files into an html form. The code, above, is the handler. I have limited the number of columns seen because the original creator of the <code>.xlsx</code> file thought it would be a great idea to have the columns go all the way out to XCF.</p>
  <p>The rows also go all the way out to somewhere around 10,000. So, I want to find the first blank row and stop there.</p>
  <p><strong>TIA!</strong></p>