setting a cell to the sum product formula

Viewed 26

I am having a issue with this not selecting the correct range to form the formula and I can not figure out why.

Set R11 = Cells(7, 18)
Set R12 = Cells(LastRow - 1, LastColumn - 1)
Set R21 = Cells(7, LastColumn + 2)
Set R22 = Cells(LastRow - 1, LastCol2 - 1)
Set Fcell = Cells(6, LastCol2)

Fcell.Formula = "=SUMPRODUCT(" & R11 & ":" & R12 & "," & R21 & ":" & R22 & ")"
1 Answers
Set R11 = Cells(7, 18)
Set R12 = Cells(LastRow, LastColumn - 1)
Set R21 = Cells(7, LastColumn + 2)
Set R22 = Cells(LastRow, LastCol2 - 1)
Set Fcell = Cells(6, LastCol2)

Fcell.Formula = "=SUMPRODUCT(" & R11.Address & ":" & R12.Address & "," & R21.Address & ":" & R22.Address & ")"

Related