Aller au contenu principal
Version: Next

VP SET FORMULAS

VP SET FORMULAS ( rangeObj : Object ; formulasCol : Collection )

ParamètresTypeDescription
rangeObjObject->Objet plage de cellules
formulasColCollection->Collection de formules

Description

The VP SET FORMULAS command assigns a collection of formulas starting at the specified cell range.

In rangeObj, pass a range of the cell (created with VP Cell) whose formula you want to specify. If rangeObj includes multiple ranges, only the first range is used.

The formulasCol is a two-dimensional collection:

  • La collection de premier niveau contient des sous-collections de formules. Chaque sous-collection définit une ligne.
  • Chaque sous-collection définit les valeurs des cellules de la ligne. Les valeurs doivent être des éléments textuels contenant les formules à associer aux cellules.

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.

You remove the formulas in rangeObj by replacing them with an empty string ("").

Exemple 1

$formulas:=New collection
$formulas.push(New collection("MAX(B11,C11,D11)";"myMethod(G4)")) // First row
$formulas.push(New collection("SUM(B11:D11)";"AVERAGE(B11:D11)")) // Second row


VP SET FORMULAS(VP Cell("ViewProArea";6;3);$formulas) // Set the cells with the formulas

myMethod:

$0:=$1*3.33

Exemple 2

Pour supprimer des formules :

$formulas:=New collection
$formulas.push(New collection("";"")) // first collection
$formulas.push(New collection("";"")) // second collection

VP SET FORMULAS(VP Cell("ViewProArea";0;0);$formulas) // Assign to cells

Voir également

VP Get Formulas
VP GET VALUES
VP SET FORMULA
VP SET VALUES