Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default How to reference the formula in a cell.

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default How to reference the formula in a cell.

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

On Mon, 2 Nov 2009 16:16:01 -0800, fasta13
wrote:

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.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default How to reference the formula in a cell.

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.

"fasta13" wrote:

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.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default How to reference the formula in a cell.

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:

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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
format a cell with a formula so an empty reference cell shows blan M2 Excel Discussion (Misc queries) 3 November 7th 06 10:42 PM
Using a cell reference within a cell reference in a formula david Excel Worksheet Functions 2 July 1st 06 01:05 PM
How do I leave formula cell blank if 2nd reference cell is empty? Liana S Excel Discussion (Misc queries) 2 October 21st 05 04:38 PM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 1 February 11th 05 06:36 AM
Cell Formula reference to cell Based On third Cell Content Gabriel Excel Discussion (Misc queries) 0 February 11th 05 05:35 AM


All times are GMT +1. The time now is 12:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"