Returning the formula in another cell

G

gelert

Is there a way (without using VBA) to return the (string) formula of
another cell? Something like "=formula(A1)" ... which would return
whatever the formula is in A1, as a string??
 
G

Gary''s Student

If it is difficult in Excel, remember that in VBA it is as simple as:

Function foormula(s As Range) As String
foormula = s.formula
End Function

(oo on purpose)
 
R

Ron Rosenfeld

Is there a way (without using VBA) to return the (string) formula of
another cell? Something like "=formula(A1)" ... which would return
whatever the formula is in A1, as a string??

Well there is, but there are potential problems with it in versions of Excel
prior to 2002. As in you can completely crash Excel under certain
circumstances. VBA would be safer and easier. However:

Select B1, or whatever cell you wish to see the formula.

Insert/Name/Define
Names in workbook: Formula
Refers to: =GET.CELL(6,Sheet1!A1)

Then in B2, type: =Formula

And it will always show the formula in the cell to the left.


--ron
 
Top