Skip to main content
Version: Next

VP Get formulas

VP Get formulas ( rangeObj : Object ) : Collection

ParameterTypeDescription
rangeObjObject->Range object
ResultCollection<-Collection of formula values

Description

The VP Get formulas command retrieves the formulas from a designated rangeObj.

In rangeObj, pass a range whose formulas you want to retrieve. If rangeObj designates multiple ranges, the formula of the first range is returned. If rangeObj does not contain any formulas, the command returns an empty string.

The returned collection is two-dimensional:

  • The first-level collection contains subcollections of formulas. Each subcollection reprensents a row.
  • Each subcollection defines cell values for the row. Values are text elements containing the cell formulas.

Example

You want to retrieve the formulas in the Sum and Average columns from this document:

You can use this code:

$formulas:=VP Get formulas(VP Cells("ViewProArea";5;1;2;3))
//$formulas[0]=[Sum(B2:D2),Average(B2:D2)]
//$formulas[1]=[Sum(B3:D3),Average(B3:D3)]
//$formulas[2]=[Sum(B4:D4),Average(C4:D4)]

See also

VP Get formula
VP Get values
VP SET FORMULAS
VP SET VALUES