My VBA enters a formula in a cell. This formula references another sheet.
I'd like to replace the sheet name '13) Friends Mailer' with a string variable, so the formula references a sheet of my choosing.
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-2],'13) Friends Mailer'!R6C1:R90C15,14,0)+VLOOKUP(RC[-2],'13) Friends Mailer'!R6C1:R90C15,15,0)"
I tried:
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-2],'" &worksheetName& "'!R[4]C[-9]:R[88]C[5],14,0)+VLOOKUP(RC[-2],'13) Friends Mailer'!R[4]C[-9]:R[88]C[5],15,0)"