title: VBA run time error 1004 in VBA, application defined or object definned error
body: <p>I am getting the error raised above on a piece of code I reuse very regularly. I cannot for the life of me figure out what the issue is. The error is occur at this line:</p>
  
  <pre><code>ws4.Range("F2:F" &amp; LastRow).Formula = "=IF(D2="", E2, D2)"
  </code></pre>
  
  <p>Then LastRow variable is working and ws4 is defined. I am lost.</p>
  
  <p>Thanks</p>