Returning a cell's formula in a different cell

G

Guest

Is it possible to have any given cell return another cell's formula? I have
a column in a certain spreadsheet that I use for debugging purposes where I
copy the formula from a cell in the same row and paste it into the cell in
that column with an apostrophe at the beginning so that I can actually see
the formula. Trouble is, if I ever add a row above, the formula that I
copied and pasted is now incorrect. I want to be able to format the cells in
my 'debugging' column so that they will return the formula of the target cell
without actually performing the formula.

I hope that wasn't too confusing... :)

Thanks in advance for any help.
 
G

Guest

My best suggestion is to but the following User-Defined-Function in your
Personal.xls.

'/==================================/
Public Function FormulaView(Select_Cell As Range) As String

FormulaView = Select_Cell.Formula

End Function
'/==================================/

Then you can use the function as...

=FormulaView(C5)

and the cell will show the formula that is in C5.

HTH,
 

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