Forum Discussion
MS85CB
Jul 21, 2022Copper Contributor
VBA code auto-updated with @ symbol (Spill) and breaking the formula when macro is run.
Greetings, I have a specific formula I want to enter into a cell: Range("D1").Formula = "=SUM(IF(FREQUENCY(IF(B3:B" & lastrow & "<>"""",MATCH(B3:B" & lastrow & ",B3:B" & lastrow & ",0)),ROW(B...
MS85CB
Jul 21, 2022Copper Contributor
I have what I think is a workaround for now, using "Formula2" instead of "Formula".
Range("D1").Formula2 = "=SUM(IF(FREQUENCY(IF(B3:B" & lastrow & "<>"""",MATCH(B3:B" & lastrow & ",B3:B" & lastrow & ",0)),ROW(B3:B" & lastrow & ")-ROW(B3)+1),1))"
https://docs.microsoft.com/en-us/office/vba/api/excel.range.formula2
I'd still like to hear from others if they think this is the right solution or if you recommend an alternative way.
Thanks!
Range("D1").Formula2 = "=SUM(IF(FREQUENCY(IF(B3:B" & lastrow & "<>"""",MATCH(B3:B" & lastrow & ",B3:B" & lastrow & ",0)),ROW(B3:B" & lastrow & ")-ROW(B3)+1),1))"
https://docs.microsoft.com/en-us/office/vba/api/excel.range.formula2
I'd still like to hear from others if they think this is the right solution or if you recommend an alternative way.
Thanks!