I know I have this asked and answered before, but I can’t for the life of me find it.
I am using the following VBA code from an Access module to put a formula in a specific cell
strSQL = “P2:P” & r
.Range(strSQL).FormulaR1C1 = “=IF(SUM(J2-H2-M2)<U2,(J2-H2-M2),U2)"
When I open the spreadsheet instead of the above, I have "=IF(SUM('J2'-'H2'-'M2')<'U2',('J2'-'H2'-'M2'),'U2')". For some reason I am getting apostrophe's (') after each cell. What am I doing wrong?
Thanks in advance for your guidance.