ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   display formula (https://www.excelbanter.com/excel-discussion-misc-queries/145534-display-formula.html)

S3

display formula
 
How do i display a formula or function in the cell next to the one containing
the result.
For example the function =date(2008,1,31) in cell A1 gives me 1/31/2008 in
cell A1. Now in cell A2 I want to show the function displayed as
=date(2008,1,31) instead of the result so that one can see the function next
to the result.

I would be grateful if someone can offer me some help about doing this.

Thanks so much.

T. Valko

display formula
 
One way:

Select the formula cell A1

In the formula bar add an apostrophe to the beginning of the formula so that
it looks like this:

'=date(2008,1,31)

Then hit enter.

Now, just copy A1 to A2 then remove the apostrophe from cell A1.

Biff

"S3" wrote in message
...
How do i display a formula or function in the cell next to the one
containing
the result.
For example the function =date(2008,1,31) in cell A1 gives me 1/31/2008 in
cell A1. Now in cell A2 I want to show the function displayed as
=date(2008,1,31) instead of the result so that one can see the function
next
to the result.

I would be grateful if someone can offer me some help about doing this.

Thanks so much.




Gord Dibben

display formula
 
You could employ a User Defined Function in the adjacent cell.

Function ShowFormula(cell)
ShowFormula = "No Formula"
If cell.HasFormula Then ShowFormula = cell.Formula
End Function

=ShowFormula(cellref)

First off.........save a backup of your workbook.

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the code in there.

Save the workbook and hit ALT + Q to return to Excel window.

Enter the formula in a helper cell as explained above.


Gord Dibben MS Excel MVP

On Wed, 6 Jun 2007 18:20:00 -0700, S3 wrote:

How do i display a formula or function in the cell next to the one containing
the result.
For example the function =date(2008,1,31) in cell A1 gives me 1/31/2008 in
cell A1. Now in cell A2 I want to show the function displayed as
=date(2008,1,31) instead of the result so that one can see the function next
to the result.

I would be grateful if someone can offer me some help about doing this.

Thanks so much.




All times are GMT +1. The time now is 05:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com