Referencing External Sheets with formula
Posted: Thu Apr 20, 2023 3:49 pm
Hi,
I am doing some evaluation at present to see if I can an automate an excel workbook.
In one workbook I have values that are being populated from another sheet using
=INDIRECT("kpitrend!D"&COLUMN())
(Where kpitrend contains values...)
I have been able to use copy column to achieve what I wanted.
However my issue is on another sheet the following formula is referenced...
=(KPIs!AV4-KPIs!AW4)/KPIs!AW4
There are columns like this with these type of formulas, if in excel if copy and then paste this into the next column excel updates the formulas for these correctly and increases all the formula. I noticed that in another sheet where I do a copy and have a simple formula like (AV4/AW4) the formula is being updated.
If I copy column with this reference formula above, this doesn't happen, so I have tried to code around it..
However when I look at the formula being returned in the component for
For =KPs!AW3
I get returned as a formula [ExternSheet]AW3 so I wrote a routine to advance this 1 column but if I try and update the next column with
[ExternSheet]AX3 - I get a crash?
Is there an easier way to do this? Or if I hacked the [ExternSheet]AW3 back to KPs!AX4 and stored this would it work?
I hope this makes some sense
Phil
I am doing some evaluation at present to see if I can an automate an excel workbook.
In one workbook I have values that are being populated from another sheet using
=INDIRECT("kpitrend!D"&COLUMN())
(Where kpitrend contains values...)
I have been able to use copy column to achieve what I wanted.
However my issue is on another sheet the following formula is referenced...
=(KPIs!AV4-KPIs!AW4)/KPIs!AW4
There are columns like this with these type of formulas, if in excel if copy and then paste this into the next column excel updates the formulas for these correctly and increases all the formula. I noticed that in another sheet where I do a copy and have a simple formula like (AV4/AW4) the formula is being updated.
If I copy column with this reference formula above, this doesn't happen, so I have tried to code around it..
However when I look at the formula being returned in the component for
For =KPs!AW3
I get returned as a formula [ExternSheet]AW3 so I wrote a routine to advance this 1 column but if I try and update the next column with
[ExternSheet]AX3 - I get a crash?
Is there an easier way to do this? Or if I hacked the [ExternSheet]AW3 back to KPs!AX4 and stored this would it work?
I hope this makes some sense
Phil