title: How to fix this error 1004? Rewrite the line
body: <p>I have the following line of code in VBA:</p>
  
  <pre><code>Range("A40:A64").Formula = "=IF(index(optional_processes,row()-39)=0;"";optional_processes,row()-39))"
  </code></pre>
  
  <p>Without the <code>if-statement</code>, some cells display <code>0</code>. I want these <code>0</code>to be blanks. That's what the <code>if-statement</code> should do. I think it gives the application or object-defined error because of the double quotation marks in the statement. How can I this get blank cells instead of <code>0</code>?</p>