View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vezerid vezerid is offline
external usenet poster
 
Posts: 751
Default How to convert formula to text

Function FormulaBody(r as Range)
with r.cells(1,1)
if left(.formula) = "=" then
FormulaBody = mid(.formula,2,len(.formula))
else
FormulaBody = .formula
endif
end with
end function

Then,
=FormulaBody(B3)

HTH
Kostis Vezerides

odd wrote:
I need to convert a formula in a cell, a reference to an other spreadsheet,
to text. I.e. Cell 'Spreadsheet1'!A6 contains formula: ='spreadsheet2'!B4
in cell 'Spreadsheet1!H6 i want the text 'spreadsheet2'!B4 to appear.

How do I do that?