Welcome to MacForumz.com!
FAQFAQ      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: 3828



(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 <1109798329.505852.213600.DeleteThis@l41g2000cwc.googlegroups.com>,
"Clive Green" <email.DeleteThis@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 style='text-decoration: underline;' 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<!-- ~MESSAGE_AFTER~ -->

 >> 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: 178



(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" <email.DeleteThis@clivegreen.com> wrote in message
news:1109798329.505852.213600@l41g2000cwc.googlegroups.com...
 > 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<!-- ~MESSAGE_AFTER~ -->
 >> 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:
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...

formula bar - I am using MAC Office X Jaquar The formula bar was semi-hidden under the apple title bar. It then moved to the middle of the screen. I could not move it from the middle of the screen. I restarted the computer and now there isn't a formula bar. View....

no formula bar - My formula bar has completely disappeared. Selecting formula bar in the drop down menu or preferences has no effect. It is not shown with or without it checked in either. Has always been there in the past. Mac OS 10.2.8 Office 10.1.5

Formula bar gone - Somehow, I lost formula bar, even I selected formular bar in View menu = and=20 Preference.
   Macintosh computer (Home) -> Excel All times are: Pacific Time (US & Canada) (change)
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 ]