View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Anthony D Anthony D is offline
external usenet poster
 
Posts: 78
Default how to setup GETFORMULA() in EXCEL 2003?

Not sure if this is the meaning of volatile you are referring to ?
The default is that a user defined function (UDF) is volatile -
"The function will be recalculated whenever calculation occurs in any cells
on the worksheet on which this function appears."
A UDF can be set to be non-volatile instead:

Function GetFormula(Cell as Range) as String
Application.Volatile(False)
etc.

Hth
Anthony
ps (going offline now, back tomorrow)

"romelsb" wrote:

thanks again....is this function will not cause any trouble say like a
volatile one...
--
"Bright minds are blessed to those who share them.."-rsb.


"Anthony D" wrote:

Glad it works, thank you for your feedback.
David McRitchie gives the following examples:

=GetFormula(A1) -- Display the formula used in cell
A1
=GetFormula(sheet150!A1) -- get the formula used on another
worksheet
=GetFormula([WBName.xls]WSName!A1) -- from another workbook with
caution

Anthony

"romelsb" wrote:

would this module good to get formula from another worksheet or even from
another workbook?
--
"Bright minds are blessed to those who share them.."-rsb.


"Anthony D" wrote:

Hi Romelsb,

Would this link be helpful ?
http://www.mvps.org/dmcritchie/excel/formula.htm
giving the code for GetFormula as a User Defined Function.
This may be entered via Tools, Macro, Visual Basic Editor, Insert Module.

Function GetFormula(Cell as Range) as String
GetFormula = Cell.Formula
End Function


Regards
Anthony

"romelsb" wrote:

Can someone please explain how to setup GETFORMULA() in EXCEL 2003? thanks...
--
"Bright minds are blessed to those who share them.."-rsb.