I am really struggling with how to insert formulas in cells using VBA and loops and it would be very kind if someone can show me an example of how to insert different formulas in different columns.
I would like to learn so that I can use this in my workbooks.
Row1 contains headers from A1 to G1.
Row2 to row10 contains randbetween(0,10) in the Range(A2:E10)
I would like to use some kind of loop to insert the following formulas in these cells.
I am trying to get formula#1 in column F in the range of F2:F10 and formula#2 in column G in the range of G2:G10 and formula#3 in column H.
I would like to learn so that I can use this in my workbooks.
Row1 contains headers from A1 to G1.
Row2 to row10 contains randbetween(0,10) in the Range(A2:E10)
I would like to use some kind of loop to insert the following formulas in these cells.
Code:
Formula#1 ="SUM(A2:A10)"
Formula#2 ="AVERAGE(A2:E10)"
Formula#3 = =SUMPRODUCT($B$2:$E$2;B2:E2)
I am trying to get formula#1 in column F in the range of F2:F10 and formula#2 in column G in the range of G2:G10 and formula#3 in column H.
Last edited: