title: macros vba need to apply formula to column till it has value in the last row
body: <p><strong>I need to apply "IF "formula in whole C column till has last value in the sheet using VBA .</strong> </p>
  
  <p>but i am getting error 438 if i use the following code . Plz help me</p>
  
  <pre><code>Sub test11()
  
  With Sheets("Sheet")
          .Range("c1:c" &amp; .Cells(.Rows.Count, "A").End(xlUp).Row).Formula = "=IF(B1="",TRIM(A1),TRIM(B1))"
  
      End With
  
  
  
  End Sub
  </code></pre>