Dear All,
I am struggling with this issue for a while.
I have to build a macro that changes formulas references according to a given set of criteria (basically moving the reference if it refers to external factor and staying at the previous year if it internal)
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Type[/TD]
[TD]name[/TD]
[TD]2016[/TD]
[TD]2017[/TD]
[TD]2018[/TD]
[TD]2019[/TD]
[TD]2020[/TD]
[TD]2021[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]external[/TD]
[TD]price[/TD]
[TD]100[/TD]
[TD]101[/TD]
[TD]95[/TD]
[TD]98[/TD]
[TD]78[/TD]
[TD]58[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]internal[/TD]
[TD]discount[/TD]
[TD]5[/TD]
[TD]5[/TD]
[TD]4[/TD]
[TD]2[/TD]
[TD]-1[/TD]
[TD]-5[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]internal[/TD]
[TD]volume[/TD]
[TD]10[/TD]
[TD]11[/TD]
[TD]10,5[/TD]
[TD]11[/TD]
[TD]10[/TD]
[TD]11[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD]formula[/TD]
[TD]=(C2-C3)*C4[/TD]
[TD]=(C2-D3)*D4[/TD]
[TD]=(D2-E3)*E4[/TD]
[TD]=(E2-F3)*F4[/TD]
[TD]=(F2-G3)*G4[/TD]
[TD]=(G2-H3)*H4[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Unfortunately there are no standard formulas that are calculated.
I would like only to insert the first formula (in C6) and then build a macro that extend it. I know that it is possible but I cannot get around it
I am struggling with this issue for a while.
I have to build a macro that changes formulas references according to a given set of criteria (basically moving the reference if it refers to external factor and staying at the previous year if it internal)
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Type[/TD]
[TD]name[/TD]
[TD]2016[/TD]
[TD]2017[/TD]
[TD]2018[/TD]
[TD]2019[/TD]
[TD]2020[/TD]
[TD]2021[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]external[/TD]
[TD]price[/TD]
[TD]100[/TD]
[TD]101[/TD]
[TD]95[/TD]
[TD]98[/TD]
[TD]78[/TD]
[TD]58[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]internal[/TD]
[TD]discount[/TD]
[TD]5[/TD]
[TD]5[/TD]
[TD]4[/TD]
[TD]2[/TD]
[TD]-1[/TD]
[TD]-5[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]internal[/TD]
[TD]volume[/TD]
[TD]10[/TD]
[TD]11[/TD]
[TD]10,5[/TD]
[TD]11[/TD]
[TD]10[/TD]
[TD]11[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD]formula[/TD]
[TD]=(C2-C3)*C4[/TD]
[TD]=(C2-D3)*D4[/TD]
[TD]=(D2-E3)*E4[/TD]
[TD]=(E2-F3)*F4[/TD]
[TD]=(F2-G3)*G4[/TD]
[TD]=(G2-H3)*H4[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Unfortunately there are no standard formulas that are calculated.
I would like only to insert the first formula (in C6) and then build a macro that extend it. I know that it is possible but I cannot get around it