Skip to main content
Version: 20 R6 BETA

VP SHOW CELL

VP SHOW CELL ( rangeObj : Object { ; vPos : Integer; hPos : Integer } )

ParameterTypeDescription
rangeObjObject->Range object
vPosInteger->Vertical view position of cell or row
hPosInteger->Horizontal view position of cell or row

Description

The VP SHOW CELL command vertically and horizontally repositions the view of the rangeObj.

In rangeObj, pass a range of cells as an object to designate the cells to be viewed. The view of the rangeObj will be positioned vertically or horizontally (i.e., where rangeObj appears) based on the vPos and hPos parameters. The vPos parameter defines the desired vertical position to display the rangeObj, and the hPos parameter defines the desired horizontal position to display the rangeObj.

The following selectors are available:

SelectorDescriptionAvailable with vPosAvailable with hPos
vk position bottomVertical alignment to the bottom of cell or row.X
vk position centerAlignment to the center. The alignment will be to the cell, row, or column limit according to the view position indicated:
  • Vertical view position - cell or row
  • Horizontal view position - cell or column
  • XX
    vk position leftHorizontal alignment to the left of the cell or columnX
    vk position nearestAlignment to the closest limit (top, bottom, left, right, center). The alignment will be to the cell, row, or column limit according to the view position indicated:
  • Vertical view position (top, center, bottom) - cell or row
  • Horizontal view position (left, center, right) - cell or column
  • XX
    vk position rightHorizontal alignment to the right of the cell or columnX
    vk position topVertical alignment to the top of cell or rowX

    This command is only effective if repositioning the view is possible. For example, if the rangeObj is in cell A1 (the first column and the first row) of the current sheet, repositioning the view will make no difference because the vertical and horizontal limits have already been reached (i.e., it is not possible to scroll any higher or any more to the left). The same is true if rangeObj is in cell C3 and the view is repositioned to the center or the bottom right. The view remains unaltered.

    Example

    You want to view the cell in column AY, row 51 in the center of the 4D View Pro area:

    $displayCell:=VP Cell("myVPArea";50;50)
    // Move the view to show the cell
    VP SHOW CELL($displayCell;vk position center;vk position center)

    Result:

    The same code with the vertical and horizontal selectors changed to show the same cell positioned at the top right of the 4D View Pro area:

    $displayCell:=VP Cell("myVPArea";50;50)
    // Move the view to show the cell
    VP SHOW CELL($displayCell;vk position top;vk position right)

    Result:

    See also

    VP Cell
    VP Get active cell
    VP Get selection
    VP RESET SELECTION
    VP SET ACTIVE CELL
    VP SET SELECTION