Skip to main content
Version: Next

VP SET FORMULA

VP SET FORMULA ( rangeObj : Object ; formula : Text { ; formatPattern : Text } )

ParameterTypeDescription
rangeObjObject->Range object
formulaText->Formula or 4D method
formatPatternText->Format of field

Description

The VP SET FORMULA command assigns a specified formula or 4D method to a designated cell range.

In rangeObj, pass a range of the cell(s) (created for example with VP Cell or VP Column) whose value you want to specify. If rangeObj includes multiple cells, the formula specified will be linked in each cell.

The formula parameter specifies a formula or 4D method name to be assigned to the rangeObj.

If the formula is a string, use the period . as numerical separator and the comma , as parameter separator. If a 4D method is used, it must be allowed with the VP SET ALLOWED METHODS command.

The optional formatPattern defines a pattern for the formula.

You remove the formula in rangeObj by replacing it with an empty string ("").

Example 1

VP SET FORMULA(VP Cell("ViewProArea";5;2);"SUM($A$1:$C$10)")

Example 2

To remove the formula:

VP SET FORMULA(VP Cell("ViewProArea";5;2);"")

Example 3

VP SET FORMULA($range;"SUM(A1,B7,C11)") //"," to separate parameters

See also

Cell format
VP Get Formula
VP SET FORMULAS
VP SET VALUE