2.1.13 dlgRowColGoto

Brief Information

Go to and select specified row and column

Command Line Usage

1. dlgRowColGoto r1:=10 c1:=2;

2. dlgRowColGoto r1:=10 c1:=2 wks:=[book1]sheet1;

X-Function Execution Options

Please refer to the page for additional option switches when accessing the x-function from script

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Go to Row r1

Input

int

<optional>

It specifies the row number to go.

Go to Column c1

Input

int

<optional>

It specifies the column number to go.

Worksheet wks

Input

Worksheet

<active>

It specifies the name of worksheet.

Extend Selection select

Input

int

0

This is only available when you have selected one or more regions. It specifies whether or not to extend the selection from the last region that you choose. The default setting is 0.

Description

This function is used to go to specified row and column. Please note that when you use Extend Selection, if multiple regions are selected, only last region will be extended.

Examples

  • If you want to go to the 3rd row in column 2 of sheet1 in book2, you can use the following command:
    dlgRowColGoto r1:=3 c1:=2 wks:=[book2]sheet1.
  • This function will scroll a worksheet to a selected row and/or column. If both row and column are specified, then the particular cell is selected.
newbook;
// Start with 100 rows and 10 columns of random data
WKS.NCOLS=10;
loop(ii,1,10) {
    wcol(ii) = uniform(100);
}
// Look for the maximum value
maxval = -1e6;
maxcol = 0;
maxrow = 0;
loop(ii,1,10)
{
    limit wcol(ii);
    if( limit.ymax > maxval )
    {
        maxval = limit.ymax;
        maxcol = ii;
        maxrow = limit.imax;
    }
}

// Use our function to select the found maximum
range mycol=%(maxcol);
dlgrowcolgoto r1:=maxrow c1:=mycol;
// and color the cell
wcellcolor color:=color(red);
wcellcolor color:=color(yellow) type:=1;

Related X-Functions


Keywords:jump to