ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Returning the formula in another cell (https://www.excelbanter.com/excel-worksheet-functions/43965-returning-formula-another-cell.html)

gelert

Returning the formula in another cell
 

Is there a way (without using VBA) to return the (string) formula of
another cell? Something like "=formula(A1)" ... which would return
whatever the formula is in A1, as a string??


--
gelert
------------------------------------------------------------------------
gelert's Profile: http://www.excelforum.com/member.php...o&userid=26998
View this thread: http://www.excelforum.com/showthread...hreadid=402017


Gary''s Student

If it is difficult in Excel, remember that in VBA it is as simple as:

Function foormula(s As Range) As String
foormula = s.formula
End Function

(oo on purpose)
--
Gary''s Student


"gelert" wrote:


Is there a way (without using VBA) to return the (string) formula of
another cell? Something like "=formula(A1)" ... which would return
whatever the formula is in A1, as a string??


--
gelert
------------------------------------------------------------------------
gelert's Profile: http://www.excelforum.com/member.php...o&userid=26998
View this thread: http://www.excelforum.com/showthread...hreadid=402017



Ron Rosenfeld

On Mon, 5 Sep 2005 18:17:26 -0500, gelert
wrote:


Is there a way (without using VBA) to return the (string) formula of
another cell? Something like "=formula(A1)" ... which would return
whatever the formula is in A1, as a string??


Well there is, but there are potential problems with it in versions of Excel
prior to 2002. As in you can completely crash Excel under certain
circumstances. VBA would be safer and easier. However:

Select B1, or whatever cell you wish to see the formula.

Insert/Name/Define
Names in workbook: Formula
Refers to: =GET.CELL(6,Sheet1!A1)

Then in B2, type: =Formula

And it will always show the formula in the cell to the left.


--ron


All times are GMT +1. The time now is 08:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com