Aug 13 2020 11:20 AM
I need to retrieve the existing formula from a cell not the value of the formula.
what function(s) do I use to do that?
Aug 13 2020 11:23 AM
Aug 13 2020 11:37 AM
thank you for your reply.
I am working in VBA. I did find an answer that worked.
= .cells(cellrefernce).formula
Aug 13 2020 12:56 PM - edited Aug 13 2020 12:59 PM
That would do it. If your version of Excel does not feature FORMULATEXT() you could emulate it with a UDF
Function showFormula(target As Range) As String
showFormula = target.Formula
End Function
called with
= showFormula(cellRef)
The Formula property and its variants can also be set from VBA, allowing the worksheet to be built from code.