Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 44
Default Function to convert a formula to text

Hello all,

i presently have a function that converts a formula entered in a cell into
text such that a viewer can see the formula as it was typed:

Function ShowFormula(rg As Range) As String
ShowFormula = rg.Formula
End Function

the user simply types =ShowFormula(cell) and the formula is revealed.

the problem is that the result is in the format =d4+d5-SQRT(f5) when i would
like it to read =44+33-sqrt(69)

is there a way to modify the function such it it shows the numbers from the
linked cells rather than the address of the cell?

thank you very much
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 273
Default Function to convert a formula to text

Lawson,

Clicking Ctrl+` will show all formalas on the worksheet.

"lawson" wrote:

Hello all,

i presently have a function that converts a formula entered in a cell into
text such that a viewer can see the formula as it was typed:

Function ShowFormula(rg As Range) As String
ShowFormula = rg.Formula
End Function

the user simply types =ShowFormula(cell) and the formula is revealed.

the problem is that the result is in the format =d4+d5-SQRT(f5) when i would
like it to read =44+33-sqrt(69)

is there a way to modify the function such it it shows the numbers from the
linked cells rather than the address of the cell?

thank you very much

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 44
Default Function to convert a formula to text

yes, but that does nothing for me in terms of showing the values like i asked.

"Gary" wrote:

Lawson,

Clicking Ctrl+` will show all formalas on the worksheet.

"lawson" wrote:

Hello all,

i presently have a function that converts a formula entered in a cell into
text such that a viewer can see the formula as it was typed:

Function ShowFormula(rg As Range) As String
ShowFormula = rg.Formula
End Function

the user simply types =ShowFormula(cell) and the formula is revealed.

the problem is that the result is in the format =d4+d5-SQRT(f5) when i would
like it to read =44+33-sqrt(69)

is there a way to modify the function such it it shows the numbers from the
linked cells rather than the address of the cell?

thank you very much

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 524
Default Function to convert a formula to text

Thu, 20 Dec 2007 11:29:02 -0800 from lawson
:
i presently have a function that converts a formula entered in a cell into
text such that a viewer can see the formula as it was typed:

Function ShowFormula(rg As Range) As String
ShowFormula = rg.Formula
End Function

the user simply types =ShowFormula(cell) and the formula is revealed.

the problem is that the result is in the format =d4+d5-SQRT(f5) when i would
like it to read =44+33-sqrt(69)

is there a way to modify the function such it it shows the numbers from the
linked cells rather than the address of the cell?


Yes, there's a way, but it would take a LOT of programming. You'd
essentially have to duplicate some of the Excel parser.

It's not as simple as just looking for cell references, looking up
the cell values, and replacing them. You'd also have to be prepared
to cope with defined names.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
"If there's one thing I know, it's men. I ought to: it's
been my life work." -- Marie Dressler, in /Dinner at Eight/
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert function return value to text? merri Excel Worksheet Functions 3 November 22nd 07 11:04 PM
Function or formula to convert "text" month to number of month? Steve Vincent Excel Discussion (Misc queries) 5 May 15th 07 01:11 AM
Function to Convert dollar to text? dspratley Excel Worksheet Functions 2 May 18th 06 03:00 PM
Function or formula to convert "text" month to number of month? Kevin Vaughn Excel Discussion (Misc queries) 0 February 4th 06 04:45 PM
Function or formula to convert "text" month to number of month Steve Vincent Excel Discussion (Misc queries) 1 February 4th 06 04:19 PM


All times are GMT +1. The time now is 08:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"