Forum Discussion

4 Replies

    • Don_Raflik's avatar
      Don_Raflik
      Copper Contributor

      mathetes 

       

      thank you for your reply. 

      I am working in VBA. I did find an answer that worked. 

      = .cells(cellrefernce).formula 

      • PeterBartholomew1's avatar
        PeterBartholomew1
        Silver Contributor

        Don_Raflik 

        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.

Resources