T
TobiasAL
Hi,
I'm gonna illustrate this by an example as I think it is the easiest
way to explain what I need:
A1 = 10
A2 = 5
A3 = 2 because A3 = A1/A2
Now, what I want is to be able to in cell B3 to write some sort of
formula e.g. =GetFormula(A3) that will give me:
=10/5 and NOT =A1/A2 , NOR 2
Does anyone know what I can do?
I don't know how to work with VBA or anything, but I know how to copy-
paste if you know the codes.
I previously got the following answer:
-------------------------
Here is a custom function that will do what you want.
To install the custom function:
Alt+F11 to open the VBA editor
Select from the VBA menu: Insert\ Module
Paste the code below in the VBA edit window
Back in Excel use the formula =GetFormula(A3) to get the formula of
cell A3
---
Function GetFormula(rng As Range) As String
GetFormula = rng.Formula
End Function
-------------------------
But it returns the cell references (=A1/A2) that have been used, not
the actual numbers in those cells (=10/5).
Anyway to get it to show the values?
I know the VALUE(ROUND(CELL,DECIMALS))"& and so forth, but it is very
time consuming.
Hope you can help!
I'm gonna illustrate this by an example as I think it is the easiest
way to explain what I need:
A1 = 10
A2 = 5
A3 = 2 because A3 = A1/A2
Now, what I want is to be able to in cell B3 to write some sort of
formula e.g. =GetFormula(A3) that will give me:
=10/5 and NOT =A1/A2 , NOR 2
Does anyone know what I can do?
I don't know how to work with VBA or anything, but I know how to copy-
paste if you know the codes.
I previously got the following answer:
-------------------------
Here is a custom function that will do what you want.
To install the custom function:
Alt+F11 to open the VBA editor
Select from the VBA menu: Insert\ Module
Paste the code below in the VBA edit window
Back in Excel use the formula =GetFormula(A3) to get the formula of
cell A3
---
Function GetFormula(rng As Range) As String
GetFormula = rng.Formula
End Function
-------------------------
But it returns the cell references (=A1/A2) that have been used, not
the actual numbers in those cells (=10/5).
Anyway to get it to show the values?
I know the VALUE(ROUND(CELL,DECIMALS))"& and so forth, but it is very
time consuming.
Hope you can help!