英文:
How to loop with FormulaR1C1
问题
I'm trying to loop in VBA with FormulaR1C1, but when I put the "R4C(15+i)" the result breaks on the front.
The VBA Formula I'm placing:
For i = 1 To 20
Range("O5").Offset(0, i) = "=SumIfs(C10,C2,R5C15,C6,R4C(15+i))"
Next
The result I'm getting on the front:
It's in Spanish, but the important part is the part that doesn't work at the end "@W$4(15+@i)".
=SUMAR.SI.CONJUNTO($J:$J,$B:$B,$O$5,$F:$F,@W$4(15+@i))
英文:
Im trying to loop in vba with FormulaR1C1, but when I put the "R4C(15+i)" the result breaks on the front.
The VBA Formula im placing:
For i = 1 To 20
Range("O5").Offset(0, i) = "=SumIfs(C10,C2,R5C15,C6,R4C(15+i))"
Next
The result Im getting on the front:
Its in spanish, but the important part is the part that dosent work at the end "@W$4(15+@i)".
=SUMAR.SI.CONJUNTO($J:$J,$B:$B,$O$5,$F:$F,@W$4(15+@i))
答案1
得分: 0
尝试这样:
对于 i 从 1 到 20:
范围("O5").偏移(0, i) = "=SumIfs(C10,C2,R5C15,C6,R4C" + (15+i) + ")"
英文:
Try it like this:
For i = 1 To 20
Range("O5").Offset(0, i) = "=SumIfs(C10,C2,R5C15,C6,R4C" & (15+i) & ")"
Next
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论