Below VBA code implement a formula into selected cell:
Sub Insert_formula() Dim frmla as string frmla = “=SUM(R2C10:R20C10)” ActiveCell.FormulaR1C1 = frmla End sub
Complex formulas also can be implemented in the same manner. Ie convert the formula to a string and assign it to active cell