This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v19
VP Get formula by name

VP Get formula by name 


 

VP Get formula by name ( vpAreaName ; name {; scope} ) -> Function result 
Parameter Type   Description
vpAreaName  Text in 4D View Pro area form object name
name  Text in Name of the named range
scope  Number in Target scope (default=current sheet)
Function result  Object in Named formula or named range definition

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:

 

Constant Value Comment
vk current sheet -1 Designates current sheet of the 4D View Pro area (default)
vk workbook -2 Designates the entire workbook of the 4D View Pro area.

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

 
PROPERTIES 

Product: 4D
Theme: 4D View Pro Language
Number: 9558

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v17 R4

 
ARTICLE USAGE

4D View Pro Reference ( 4D v19)