printing formulas in adjacent cells


Posted by Craig on May 07, 2001 11:51 AM

I would like to print the formulas in adjacent cells of the formula? Any Ideas?
Example:

in C2 the answer to formula A2 + B2 is printed however in D2 I would like the cell to print A2 + B2.

Thanks

Posted by IML on May 07, 2001 12:27 PM

You could try going to you formula row and highlighting it. YOu can then find the equal sign and replace it with '=.
Now copy and paste this row where you want to show them. Now, go back to first column and find '= and replace with a =.
who knows, it may work!

Good luck

Posted by Craig on May 07, 2001 2:47 PM

IML, Thanks your instructions work however I was looking for more of a stream-lined approach. Like a function or formula that I could copy many times. I will keep trying...

CRaig

Posted by Craig on May 07, 2001 2:48 PM

IML, Thanks your instructions work however I was looking for more of a stream-lined approach. Like a function or formula that I could copy many times. I will keep trying...

CRaig



Posted by Ivan Moala on May 07, 2001 6:10 PM

You could try a UDF (User defined function)
eg.

Function sFormula(cell As Range) As String
Dim F
Application.Volatile
If cell.HasFormula = True Then
F = cell.Formula
sFormula = F
End If
End Function

Place this code into a module.
Then in cell D2 put in;
=sFormula(B2)
copy down as needed.


Ivan