title: How do I emulate Excel's "Fill down" in Apache POI?
body: <p>I've got a template workbook, with a sheet (&quot;All data&quot;) which I populate using Apache POI. I don't know how many rows I'm going to need in &quot;All data&quot; when I start.</p>
  <p>In another sheet (call it &quot;Calc&quot;), I have 4 columns containing formulae that do stuff based on &quot;All data&quot;. I need to have as many rows in Calc as in &quot;All data&quot;, and I thought the easiest way to do it would be to have, in the template, one row with the formulae in it, which I can then fill down the sheet as many times as necessary.</p>
  <p>Thus, in the template I have:</p>
  <pre><code> Col1Header     | Col2Header                            | Col3Header                            | Col4Header
  =+'All data'!F2 | =IF(LEFT(A55,1)=&quot;4&quot;,'All data'!R2,&quot;&quot;) | =IF(LEFT(A55,1)=&quot;4&quot;,'All data'!O2,&quot;&quot;) | =+'All data'!W2
  </code></pre>
  <p>Then I would expect to be able to &quot;fill down&quot; from that first formula line, so that I have n rows (where n is the number of rows I'm using in the &quot;All data&quot; sheet).</p>
  <p>However, I cannot see how to do &quot;fill down&quot; in Apache POI. Is it something that's not possible? Or am I looking for the wrong name?</p>
  <p>Yes, an alternative method would be simply to change the template by manually copying down more rows than I would ever expect to be using, but that is (a) inelegant and (b) is asking for trouble in the future:-)</p>
  <p>I feel sure there must be a better way?</p>