"Clive Green" <email.DeleteThis@clivegreen.com> wrote in message
news:1109798329.505852.213600@l41g2000cwc.googlegroups.com...
> I need to discover whether there is a function which will retrieve the
> FORMULA EXPRESSION that's held within another cell - for example, I'd
> like to be able to write this expression in a cell:
>
> =GETFORMULA(E4) //this would display the formula that's defined in cell
> E4 as a string
>
> Can anyone advise me on this? It would sure save me a heap of time!
>
>
> - Clive Green
>
>
Tools|Macro|Visual Basic Editor
Insert a new module i.e. Insert|Module
Paste this code into the module
Public Function ShowFormula(r As Range) As String
ShowFormula = r.FormulaLocal
End Function
You can now insert
=ShowFormula(E4) in any cell (except E4) and you will get the formula in
this cell
Regards,
Fredrik<!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: A function to display a formula that's defined within anot..