Skip to main content
Version: 20 R6 BETA

VP Get formula by name

VP Get formula by name ( vpAreaName : Text ; name : Text { ; scope : Number } ) : Object

ParameterTypeDescription
vpAreaNameText->4D View Pro area form object name
nameText->Name of the named range
scopeNumber->Target scope (default=current sheet)
ResultObject<-Named formula or named range definition

Description

The VP Get formula by name command returns the formula and comment corresponding to the named range or named formula passed in the name parameter, or null if it does not exist in the defined scope.

In vpAreaName, pass the name of the 4D View Pro area. If you pass a name that does not exist, an error is returned.

Pass the named range or named formula that you want to get in name. Note that named ranges are returned as formulas containing absolute cell references.

You can define where to get the formula in scope using either the sheet index (counting begins at 0) or the following constants:

  • vk current sheet
  • vk workbook
Returned Object

The returned object contains the following properties:

PropertyTypeDescription
formulaTextText of the formula corresponding to the named formula or named range. For named ranges, the formula is a sequence of absolute coordinates.
commentTextComment corresponding to the named formula or named range

Example

$range:=VP Cell("ViewProArea";0;0)
VP ADD RANGE NAME("Total1";$range)

$formula:=VP Get formula by name("ViewProArea";"Total1")
//$formula.formula=Sheet1!$A$1

$formula:=VP Get formula by name("ViewProArea";"Total")
//$formula=null (if not existing)

See also

VP ADD FORMULA NAME
VP Get names