close

I am trying to use a cell reference in one worksheet to a formula in another
worksheet, and want to use the formula itself instead of the result of that
formula, can anyone advise me how to do this?Hi,

I don't know if there is an existing Excel worksheet function to do this,
but the following VBA will;

Public Function ReturnFormula(Target As Range) As String

ReturnFormula = Target.Cells(1, 1).Formula

End Function

Regards,

Chris.

--
Chris Marlow
MCSD.NET, Microsoft Office XP Masterquot;MESquot; wrote:

gt; I am trying to use a cell reference in one worksheet to a formula in another
gt; worksheet, and want to use the formula itself instead of the result of that
gt; formula, can anyone advise me how to do this?
gt;



quot;MESquot; wrote:

gt; I am trying to use a cell reference in one worksheet to a formula in another
gt; worksheet, and want to use the formula itself instead of the result of that
gt; formula, can anyone advise me how to do this?
gt;

This just returns the formula as a text, is there a way that it will
calculate the function instead of showing the contents?

quot;Chris Marlowquot; wrote:

gt; Hi,
gt;
gt; I don't know if there is an existing Excel worksheet function to do this,
gt; but the following VBA will;
gt;
gt; Public Function ReturnFormula(Target As Range) As String
gt;
gt; ReturnFormula = Target.Cells(1, 1).Formula
gt;
gt; End Function
gt;
gt; Regards,
gt;
gt; Chris.
gt;
gt; --
gt; Chris Marlow
gt; MCSD.NET, Microsoft Office XP Master
gt;
gt;
gt; quot;MESquot; wrote:
gt;
gt; gt; I am trying to use a cell reference in one worksheet to a formula in another
gt; gt; worksheet, and want to use the formula itself instead of the result of that
gt; gt; formula, can anyone advise me how to do this?
gt; gt;

It is not clear to me what you want to do.

Can you post a formula and desribe what you want to do with it?

Maybe this UDF?

Function EvalCell(RefCell As String) Application.Volatile EvalCell = Evaluate(RefCell)
End Function

=evalcell(cellref)

Which does nothing more than return the value from the formula in cellref.

Just as easy to enter =cellref

Evalcell function is handy to return a value from a string such as

1 2 3Gord Dibben MS Excel MVP

On Fri, 6 Nov 2009 16:35:01 -0800, fasta13
gt; wrote:

gt;This just returns the formula as a text, is there a way that it will
gt;calculate the function instead of showing the contents?
gt;
gt;quot;Chris Marlowquot; wrote:
gt;
gt;gt; Hi,
gt;gt;
gt;gt; I don't know if there is an existing Excel worksheet function to do this,
gt;gt; but the following VBA will;
gt;gt;
gt;gt; Public Function ReturnFormula(Target As Range) As String
gt;gt;
gt;gt; ReturnFormula = Target.Cells(1, 1).Formula
gt;gt;
gt;gt; End Function
gt;gt;
gt;gt; Regards,
gt;gt;
gt;gt; Chris.
gt;gt;
gt;gt; --
gt;gt; Chris Marlow
gt;gt; MCSD.NET, Microsoft Office XP Master
gt;gt;
gt;gt;
gt;gt; quot;MESquot; wrote:
gt;gt;
gt;gt; gt; I am trying to use a cell reference in one worksheet to a formula in another
gt;gt; gt; worksheet, and want to use the formula itself instead of the result of that
gt;gt; gt; formula, can anyone advise me how to do this?
gt;gt; gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()