Get Started
Usage API
More information

GetCol

GetCol() → { number }

Get the column number for the selected cell.

Parameters:

This method doesn't have any parameters.

Returns:

Type
number

Example

Copy code
builder.CreateFile("xlsx");
oWorksheet = Api.GetActiveSheet();
oRange = oWorksheet.GetRange("D9").GetCol();
oWorksheet.GetRange("A2").SetValue(oRange.toString());
builder.SaveFile("xlsx", "GetCol.xlsx");
builder.CloseFile();

Resulting document