VP SET FORMULA
VP SET FORMULA ( rangeObj : Object ; formula : Text { ; formatPattern : Text } )
| Parameter | Type | Description | |
|---|---|---|---|
| rangeObj | Object | -> | Range object |
| formula | Text | -> | Formula or 4D method |
| formatPattern | Text | -> | 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 theVP SET ALLOWED METHODScommand.
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