How to reference the formula in a cell.

F

fasta13

Is there a function in excel that I am missing which will reference the
formula in a cell and not the value (recalculating that formula in the new
cell)?

If not, can someone who has a macro which does this post it please, it would
be very helpful.
 
G

Gord Dibben

Not too clear on what you want.

Function showfn(mycell)
If mycell.HasFormula Then
showfn = Mid(mycell.Formula, 2)
Else
showfn = ""
End If
End Function

=showfn(A1) entered in B1

Will show the formula from A1 without the "=" sign.


Gord Dibben MS Excel MVP
 
G

Geoff_L

Not exactly sure what your scenario is but have you checked out the
'INDIRECT' function? This references a formula in another cell and
effectively incorporates it within the formula with the INDIRECT function
within it.

Helpful? Hit Yes.
 
S

Stefi

A very simple UDF does the job:

Function retform(fcell As Range)
retform = fcell.Formula
End Function

Usage:

=retform(B2) in C2 returns the formula in B2.

Regards,
Stefi


„fasta13†ezt írta:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top