Help!

How do I refer to a 'formula' instead of the result of tha..

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> General Discussions RSS
Next:  excel - auto spacing  
Author Message
MES
External


Since: Mar 02, 2006
Posts: 4



PostPosted: Thu Mar 02, 2006 7:39 pm    Post subject: How do I refer to a 'formula' instead of the result of that formu
Archived from groups: microsoft>public>excel>misc (more info?)

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?
Back to top
Chris Marlow
External


Since: Feb 23, 2006
Posts: 19



PostPosted: Thu Mar 02, 2006 11:57 pm    Post subject: RE: How do I refer to a 'formula' instead of the result of that formu [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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 Master


"MES" wrote:

> 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?
>
Back to top
MES
External


Since: Mar 02, 2006
Posts: 4



PostPosted: Sun Mar 05, 2006 1:16 pm    Post subject: RE: How do I refer to a 'formula' instead of the result of that formu [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"MES" wrote:

> 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?
>
Back to top
fasta13
External


Since: Nov 06, 2009
Posts: 1



PostPosted: Fri Nov 06, 2009 4:35 pm    Post subject: RE: How do I refer to a 'formula' instead of the result of that fo [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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

"Chris Marlow" wrote:

> 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 Master
>
>
> "MES" wrote:
>
> > 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?
> >
Back to top
Gord Dibben
External


Since: Feb 23, 2004
Posts: 9177



PostPosted: Sat Nov 07, 2009 8:32 am    Post subject: Re: How do I refer to a 'formula' instead of the result of that fo [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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+3


Gord Dibben MS Excel MVP

On Fri, 6 Nov 2009 16:35:01 -0800, fasta13
<fasta13.DeleteThis@discussions.microsoft.com> wrote:

>This just returns the formula as a text, is there a way that it will
>calculate the function instead of showing the contents?
>
>"Chris Marlow" wrote:
>
>> 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 Master
>>
>>
>> "MES" wrote:
>>
>> > 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?
>> >
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> General Discussions All times are: Eastern 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 cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum