Thread: cell contents
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Brian Brian is offline
external usenet poster
 
Posts: 683
Default cell contents

Here's an approach I use:

Function FormulaText(Ref As Range) As String
FormulaText = Ref.Cells(1).Formula
End Function

"kola5567" wrote:


I have a cell that has a formula. The formula refrences other cells in
the sheet. I need some code that will give me the contents of a cell I
select. I want it to give me the formula asigned to the cell.
Everything I have tried only gives me the value resulting from the
formula.

Ex: If a cell A1 contains "= B1+B2+B3"

I want to be able to call out this formula in come code, but I want it
to give me =B1+B2+B3, and not simple that it equals say 9


--
kola5567
------------------------------------------------------------------------
kola5567's Profile: http://www.excelforum.com/member.php...o&userid=24614
View this thread: http://www.excelforum.com/showthread...hreadid=399493