Forum Discussion

JuleneDS's avatar
JuleneDS
New Contributor II
2 months ago

Custom XF formula for excel add-in

Is it possible to create a custom XF formula for users to access within the excel add-in? We want to create an member offset formula.

  • RobbSalzmann's avatar
    RobbSalzmann
    Valued Contributor II

    Alt-F11 to open the VBA Editor
    Insert a new module
    Add your code:
    Function XFMemberOffset(referenceValue As Double, memberValue As Double) As Double
    Dim Result as double
    ' Calculate something here

    'return the calculated value
    XFMemberOffset = Result
    End Function

    Save your workbook as macro enabled (.xslm)
    Alt+Q to close the VBA Editor

    In any cell in your workbook, you can now use your custom function: =XFMemberOffset(A1, B1)

    • JuleneDS's avatar
      JuleneDS
      New Contributor II

      This is what we did, we were wondering if there is some way to add our custom function to the list above so that users can select it when creating their own reports.