I am trying a calculate sum product using VBA. The code is as
Sub Result()
ActiveCell.Formula = "=SUMPRODUCT(B4:QF4,B5004:QF5004)"
End Sub
There is a variable in the program and the number of columns changes every time. I tried defining the column "QF" as a number, but this is showing an error. How do I define a column as a number in my code? I have tried the following code.
Sub Result()
ActiveCell.Formula = "=SUMPRODUCT(B4:(" & (FinalR - j) & ")4,B(" & (FR - nobis + j + 1) & "):(" & (FinalR - j) & ")5004)"
End Sub