Displaying in a cell the formula from another cell

A

Arjan

Hi,

is it possible to show (in text) the formula from the cell next to it? For
example, in cell A1 I have the formula ='D:My Documents\[test.xls]Sheet1'!D18
which gives as result "18". Can I display in cell A2 the text "D:My
Documents\[test.xls]Sheet1'!D18" somehow?

Arjan
 
N

Nick Hodge

Arjan

How about a user defined function? Enter this and take the cell you wish to
return the formula string from as the single parameter

Function ShowFormula(rngInput As Range) As Variant
Application.Volatile True
ShowFormula = rngInput.Formula
End Function

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
[email protected]
 
Top