Skip to main content
Version: 20 R6 BETA

VP ADD RANGE NAME

VP ADD RANGE NAME ( rangeObj : Object ; name : Text { ; options : Object } )

ParameterTypeDescription
rangeObjObject->Range object
nameText->Name for the fomula
optionsObject->Options for the named formula

Description

The VP ADD RANGE NAME command creates or modifies a named range in the open document.

Named ranges created by this command are saved with the document.

In rangeObj, pass the range that you want to name and in name, pass the new name for the range. If the name is already used within the same scope, the new named range replaces the existing one. Note that you can use the same name for different scopes (see below).

You can pass an object with additional properties for the named range in options. The following properties are supported:

PropertyTypeDescription
scopeNumberScope for the range. You can pass the sheet index (counting begins at 0) or use the following constants:
  • vk current sheet
  • vk workbook
  • The scope determines whether a range name is local to a given worksheet (scope=sheet index or vk current sheet), or global across the entire workbook (scope=vk workbook).
    commentTextComment associated to named range
    • A named range is actually a named formula containing coordinates. VP ADD RANGE NAME facilitates the creation of named ranges, but you can also use the VP ADD FORMULA NAME method to create named ranges.
    • Formulas defining named ranges can be retrieved with the VP Get formula by name method.

    Example

    You want to create a named range for a cell range:

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

    See also

    VP Get names
    VP Name