Search code examples
excelpropertiesformula

Use property in formula


I've added to my Excel file a new property prop.

picture of my property from the settings

enter image description here

I would now like to use the property in a formula, like =VERKETTEN(""; prop; "").

But this doesn't work :( Is there a way to use those properties in formula?


Solution

  • You can't directly use the property in a formula, you'd have to use a macro or UDF, and reference the workbook.customdocumentproperties object to get the value.

    However, to suggest a slightly different approach, there is a way to link a custom property to a cell in the workbook, meaning that the property will update when that cell is changed. The cell is a normal cell so can also be referenced in formulas.
    Whether this is a suitable approach is of course dependent on how and when the custom property is set / changed.