How to show the formula of another cell

G

Guest

Hi

I want to show the content (formula) of another cell. For instance, if the
formula in A1 is =2*12, I want cell B1 to show =2*12 instead of the answer
(24). In other words i want the answer as usual (24) in A1, and in B1 I want
the formula of A1 to be showed (=12*2).

I am not interested in showing all of the formulas in the sheet, like you
can do with tools/options/view/formulas.

Please help!
 
A

Arvi Laanemets

Hi

You can use this UDF:

Public Function ShowFormula(MyCell As Range)
ShowFormula = MyCell.Formula
End Function

Copy the function into workbook module. After that, you can use it in this
workbook as any other formula. P.e. into B1 enter
=ShowFormula(A1)
 
G

Guest

Thanks, that solved the problem. By the way, is it not possible to do this
without a UDF?
 

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