Saltar para o conteúdo principal
Versão: Próximo

VP SET FORMULAS

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

ParâmetroTipoDescrição
rangeObjObject->Objeto intervalo de células
formulasColCollection->Colecção de fórmulas

Descrição

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:

  • A coleção de primeiro nível contém subcoleções de fórmulas. Cada subcolecção define uma linha.
  • Cada subcoleção define os valores das células para a linha. Values must be text elements containing the formulas to assign to the cells.

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 ("").

Exemplo 1

$formulas:=New collection
$formulas.push(New collection("MAX(B11,C11,D11)";"myMethod(G4)")) // Primeira linha
$formulas.push(New collection("SUM(B11:D11)";"AVERAGE(B11:D11)")) // Segunda linha


VP SET FORMULAS(VP Cell("ViewProArea";6;3);$formulas) // Definir as células com as fórmulas

myMethod:

$0:=$1*3.33

Exemplo 2

Para remover fórmulas:

$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

Veja também

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