跳到主要内容

End

返回表示指定范围中指定方向末端的 Range 对象。

语法

expression.End(direction);

expression - 表示 ApiRange 类的变量。

参数

名称必需/可选数据类型默认值描述
direction必需Direction指定范围中末端的方向。*

返回值

ApiRange

示例

跳转到电子表格中范围内所选方向上最后一个已占用的单元格。

// How do I find the boundary cell of a data block by moving in a specific direction in a spreadsheet?

// Locate the edge of filled cells going left, right, up, or down and highlight it in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let range = worksheet.GetRange("C4:D5");
range.End("xlToLeft").SetFillColor(Api.CreateColorFromRGB(255, 213, 191));