ZiggyZenLand
New Member
- Joined
- Aug 12, 2017
- Messages
- 3
I'm trying to pass the value of a formula to a cell, using VBA, without entering the formula in the cell; for several rows in the same column. I'm trying to use the Evaluate method but it only works using A1 style references; so I'm unable to use R1C1 style like the below code, which works perfectly but puts the formula in the cell and not just the values.
For i = 3 To LastRow
Range("R" & i).FormulaR1C1 = "=IFERROR(IF(RC[-11]>RC[-10],""T"",""F""),""ER"")"
Next i
Below I'm trying to use the Evaluate method but don't know how to increase the row number inside the formula each time the line of code is run. With the below code, I get the value for row 3 in all my rows.
For i = 3 To LastRow
Range("R" & i).Value = Evaluate("IFERROR(IF(G3>H3,""T"",""F""),""ER"")")
Next i
I really appreciate any assistance you can provide. Thank you.
Excel 2013
For i = 3 To LastRow
Range("R" & i).FormulaR1C1 = "=IFERROR(IF(RC[-11]>RC[-10],""T"",""F""),""ER"")"
Next i
Below I'm trying to use the Evaluate method but don't know how to increase the row number inside the formula each time the line of code is run. With the below code, I get the value for row 3 in all my rows.
For i = 3 To LastRow
Range("R" & i).Value = Evaluate("IFERROR(IF(G3>H3,""T"",""F""),""ER"")")
Next i
I really appreciate any assistance you can provide. Thank you.
Excel 2013