Formula in Excel 07 to get the formula used in one cell in anothercell, showing VALUES, not cells re

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top