Formular of one cell as text shown in another cell

D

dan

Suppose Cell B3 has a formular =Start!C3.
I would want Cell D3 to have the text '=Start!C3 entered.
It can be in formular or in VBA code.
Thank you
 
N

Niek Otten

' =======================================
Function ShowFormula(a As Range)
' Niek Otten
' March 31, 2006

If Application.ReferenceStyle = xlR1C1 _
Then ShowFormula = a.FormulaR1C1Local _
Else: ShowFormula = a.FormulaLocal
End Function
' =======================================

================================================
Pasting a User Defined Function (UDF)
Niek Otten, March 31, 2006

If you find a VBA function on the Internet or somebody mails you one, and you don't know how to implement it, follow these
steps:

Select all the text of the function.
CTRL+C (that is, press and hold down the CTRL key, press C, release both). This a shortcut for Copy.
Go to Excel. Press ALT+F11 (same method: press and hold the ALT key, press the F11 key and release both). You are now in the
Visual Basic Editor (VBE).
From the menu bar, choose Insert>Module. There should now be a blank module sheet in front of you. Click in it and then
press CTRL+V (same method.). This a shortcut for Paste. You should now see the text of the function in the Module.
Press ALT+F11 again to return to your Excel worksheet.
You should now be able to use the function as if it were a built-in function of Excel, like =SUM(..)
================================================



--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| Suppose Cell B3 has a formular =Start!C3.
| I would want Cell D3 to have the text '=Start!C3 entered.
| It can be in formular or in VBA code.
| Thank you
|
|
 

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