Forum Discussion

Kraway's avatar
Kraway
Copper Contributor
May 03, 2024

adding a formula with a macro

I am adding a formula to a cell through a macro.  If I enter the formula manually it works perfectly but when I use the macro to add the formula it leaves the formula text in the cell and not the result of the formula.  Here is the code in the macro:

Range("H2").Select
ActiveCell.FormulaR1C1 = "=IF(G2="""",Today()-A2,G2-A2"

Share

Resources