I am using the vba code below to insert formula automatically.
How to make the formula not appear in the cells
I have tried .value but no success
Sub reporttwistsheet()
With Worksheets("Report")
Range("D2:G" & Range("C" & Rows.Count).End(xlUp).Row).Formula = "=SUMPRODUCT(CustomerA!W$2:W$915,--(CustomerA!$J$2:$J$915=Report!$A2),--(CustomerA!$K$2:$K$915=Report!$B2),--(CustomerA!$L$2:$L$915=Report!$C2))"
Range("H2:H" & Range("C" & Rows.Count).End(xlUp).Row).Formula = "=SUMPRODUCT(CustomerA!AD$2:AD$915,--(CustomerA!$J$2:$J$915=Report!$A2),--(CustomerA!$K$2:$K$915=Report!$B2),--(CustomerA!$L$2:$L$915=Report!$C2))"
End With
End Sub
Bookmarks