I’m trying to copy and paste a formula down a range (U11:U500) while changing the original cell reference (A11) depending on the row number in the range. I know I can use .FormulaR1C1
instead of .Formula
for this, however my reference cell (A11) in my formula doesn’t seem to change.
ws.Range("U11:U12").FormulaR1C1 = "=IF(ISERROR(MATCH(A11, 'Sheet1'!A:A, 0)), ""New SKU"", IF(INDEX('Sheet1'!AH:AH, MATCH(A11, 'Sheet1'!A:A, 0)) = 0, """", ""New SKU""))"
Looking at the formula within the cells after the macro runs, I can see quotes around my original reference cell (‘A11’) and have not changed depending on the row.
Am I using .FormulaR1C1
incorrectly?
1