title: PHPExcel how to set cell value dynamically
body: <p>How to set cell/column value dynamically using PHPExcel library?</p>
  
  <p>I am fetching result set from MySQL database and I want to write data in excel format using PHPExcel library. Looking at example </p>
  
  <pre><code>$objPHPExcel-&gt;getActiveSheet()-&gt;setCellValue('A1', 'cell value here');
  </code></pre>
  
  <p>indicates that we have to hard code cell/column reference As 'A1', then it writes to cell/column A1. How I can increment cell/column and/or row reference based on rows and corresponding column values from result set?</p>
  
  <p>Please guide.</p>