title: How to make an Excel cell equal to empty, possibly via VBA code
body: <p>Of course you're going to answer this question with the <code>=""</code> formula to be written in the aforementioned cell, but this is not my case.</p>
  
  <p>Actually, I have a function that works <strong>only</strong> if its argument is equal to an empty cell, that is, a cell that has been completely erased pressing <code>del</code> over it or such a thing.</p>
  
  <p>Obviously I cannot simply erase the content of the cell because it gets data from an external source and sometimes I need the content of that cell to be present and visible in my spreadsheet.</p>
  
  <p>The current cell's formula is something like</p>
  
  <pre><code>=if([condition], "", [formula])
  </code></pre>
  
  <p>but if the cell's value is equal to <code>""</code> instead of being simply empty, the function doesn't work anymore (on the contrary it works fine if the content is equal to <code>[formula]</code>).</p>
  
  <p>I <strong>cannot</strong> amend the function, but I can possibly write an additional VBA code to achieve the result.</p>
  
  <p>Following Daniel Cook request of posting my code, here is the formula from <strong>QuantLibXL</strong>'s <a href="http://quantlib.org/quantlibxl/func_bonds.html#qlFloatingRateBond" rel="noreferrer"><strong>qlFloatingRateBond</strong></a> function:</p>
  
  <pre><code>=qlFloatingRateBond(,,"EUR",3,,,"obj_0005#007",2,,"Actual/365",,,"obj_0004#008",,,,,,,)
  </code></pre>
  
  <p>If you amend it in </p>
  
  <pre><code>=qlFloatingRateBond(,,"EUR",3,,,"obj_0005#007",2,,"Actual/365",0,,"obj_0004#008",,,,,,,)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>=qlFloatingRateBond(,,"EUR",3,,,"obj_0005#007",2,,"Actual/365","",,"obj_0004#008",,,,,,,)
  </code></pre>
  
  <p>you get Object Handler error due to a wrong argument provided (the modification regards the <code>Floors</code> argument, I hope to not have done any mistake with the commas and the empty-default arguments...).</p>
  
  <p>The only way to make it to manage a bond without floor is to provide it a true empty cell, but if you had an external data source which returns some value in that cell according to the presence or the absence of a floor you would not be able to make it work.</p>