ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Referencing A Formula As Text (https://www.excelbanter.com/excel-programming/301183-referencing-formula-text.html)

abc[_4_]

Referencing A Formula As Text
 
Hi,

I am working on a problem to parse and manipulate parts of a formula i
one cell from another cell. In the second cell I will be carrying ou
some VBA & Logical functions. Is there any way I can get a formula i
one cell to reference a formula in another cell as text.

Thanks

--
Message posted from http://www.ExcelForum.com


GJones

Referencing A Formula As Text
 
Hi ABC;

you can go into VBA and use the Formula method to get the
string. Then you can do the manipulation and put the
desired formula in the cell you choose.

MyCurrentFormula = Range("A1").Formula

Might return =SUM(B3:C3)

Thanks,

Greg

-----Original Message-----
Hi,

I am working on a problem to parse and manipulate parts

of a formula in
one cell from another cell. In the second cell I will be

carrying out
some VBA & Logical functions. Is there any way I can get

a formula in
one cell to reference a formula in another cell as text.

Thanks,


---
Message posted from http://www.ExcelForum.com/

.


Bernie Deitrick

Referencing A Formula As Text
 
You need to use a user-defined-function

Function CellFunc(inCell As Range) As String
CellFunc = inCell.Formula
End Function

Used like

=CellFunc(A1)

HTH,
Bernie
MS Excel MVP

"abc " wrote in message
...
Hi,

I am working on a problem to parse and manipulate parts of a formula in
one cell from another cell. In the second cell I will be carrying out
some VBA & Logical functions. Is there any way I can get a formula in
one cell to reference a formula in another cell as text.

Thanks,


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 07:49 AM.

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