ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Link Formulae (https://www.excelbanter.com/excel-discussion-misc-queries/47493-link-formulae.html)

Chandra

Link Formulae
 
Friends

Is there any way in excel in which i could link the formula and not copy
them. Meaning I want to link the formulae in such a way that the formula of
the linked cell changes if there is a modification of the formula of the
parent cell.


I have elaborated by giving an example

Say I have a formula sum(A1:A5) in the cell A6 in worksheet1.
I copy the similar formula in worksheet2 at A6

Now I want the formula in worksheet2 to change if I have changed the formula
in worksheet1.

For example

If the formula in Worksheet1 A6 is changed to sum(A1:A4) , I want the
formula in Worksheet2 A6 to change automatically to sum(A1:A4)

Any Ideas how to do this in Excel.

--
Regards

Chandra

Ken Johnson

Chandra,
the only way I know of is to use a Worksheet_Change Event procedure.
Using your example the following worked for me

Private Sub Worksheet_Change(ByVal Target As Range)
Sheets(2).Range("A6").Formula = ActiveSheet.Range("A6").Formula
End Sub

I put this Sub into the Sheet 1 module.

It only works one way. The formula on Sheet 2 changes when you change
the formula on sheet 1, but not the other way around.

Hope this helps
Ken Johnson



All times are GMT +1. The time now is 07:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com