Welcome to MacForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

A function to display a formula that's defined within anot..

 
   Macintosh computer (Home) -> Excel RSS
Next:  Decent book for Mac Excel X?  
Author Message
Clive Green

External


Since: Mar 02, 2005
Posts: 1



(Msg. 1) Posted: Wed Mar 02, 2005 2:18 pm
Post subject: A function to display a formula that's defined within anothe
Archived from groups: microsoft>public>mac>office>excel (more info?)

I need to discover whether there is a function which will retrieve the
FORMULA EXPRESSION that's held within another cell - for example, I'd
like to be able to write this expression in a cell:

=GETFORMULA(E4) //this would display the formula that's defined in cell
E4 as a string

Can anyone advise me on this? It would sure save me a heap of time!


- Clive Green

 >> Stay informed about: A function to display a formula that's defined within anot.. 
Back to top
Login to vote
JE McGimpsey

External


Since: Mar 07, 2004
Posts: 2394



(Msg. 2) Posted: Wed Mar 02, 2005 3:46 pm
Post subject: Re: A function to display a formula that's defined within an [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article ,
"Clive Green" <email.RemoveThis@clivegreen.com> wrote:

 > I need to discover whether there is a function which will retrieve the
 > FORMULA EXPRESSION that's held within another cell - for example, I'd
 > like to be able to write this expression in a cell:
 >
 > =GETFORMULA(E4) //this would display the formula that's defined in cell
 > E4 as a string
 >
 > Can anyone advise me on this? It would sure save me a heap of time!
 >

You can do this most easily with a User Defined Function (UDF). If
you're not familiar with UDFs, you may want to see David McRitchie's

Getting Started with Macros and User Defined Functions
<a rel="nofollow" style='text-decoration: none;' href="http://www.mvps.org/dmcritchie/excel/getstarted.htm" target="_blank">http://www.mvps.org/dmcritchie/excel/getstarted.htm</a>

Put this in a regular code module in your workbook. Type Opt-F11 to
enter the VBE. Choose Insert/Module, and in the window that opens, paste
in

Public Function GetFormula(ByVal rng As Range) As String
GetFormula = rng(1).Formula
End Function

 >> Stay informed about: A function to display a formula that's defined within anot.. 
Back to top
Login to vote
Fredrik Wahlgren

External


Since: Sep 10, 2004
Posts: 116



(Msg. 3) Posted: Thu Mar 03, 2005 9:53 pm
Post subject: Re: A function to display a formula that's defined within an [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Clive Green" wrote in message

 > I need to discover whether there is a function which will retrieve the
 > FORMULA EXPRESSION that's held within another cell - for example, I'd
 > like to be able to write this expression in a cell:
 >
 > =GETFORMULA(E4) //this would display the formula that's defined in cell
 > E4 as a string
 >
 > Can anyone advise me on this? It would sure save me a heap of time!
 >
 >
 > - Clive Green
 >
 >

Tools|Macro|Visual Basic Editor
Insert a new module i.e. Insert|Module

Paste this code into the module

Public Function ShowFormula(r As Range) As String
ShowFormula = r.FormulaLocal
End Function

You can now insert
=ShowFormula(E4) in any cell (except E4) and you will get the formula in
this cell

Regards,
Fredrik
 >> Stay informed about: A function to display a formula that's defined within anot.. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Compile Error: Sub or Function not defined - Greetings - A developer in a central office at the university I work at developed a one-file Excel solution to automatically cleanup submitted data from around our university for incorporation into a central system. This file is built in Excel on..

insert defined name - in win Excel, when using the vlookup function, I could hit F3 to bring up a list of defined names to choose from for the 'table_array' portion of the formula. What's the equivalent keystroke for Mac Excel 2004 and 2008? Thanks.

EVALUATE in defined name question - I'm trying to use a defined name containing an EVALUATE(VLOOKUP...). The VLOOKUP is referencing another spreadsheet in a path based on a date, and whose name is also based on a date. The defined name works perfectly if I just cut and past the VLOOKUP..

user-defined functions on Excel - At work I use a Windows PC and i am planning on buying a laptop in the next few days. I would love to buy a Powerbook or iBook. However it would be absolutely critical that the excel spreadsheets we use at work funtion well on a Mac. My main sheet is...

Adding User-Defined Chart Types to Gallery - Did microsoft REALLY do away with the ability to create user-defined chart types in excel??? I do hundreds of charts in the course of a project, and this means that I will have to MANUALLY change the font and colors, etc. for each one of them!! I see a...
   Macintosh computer (Home) -> Excel All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]