ExcelScript.WorkbookRangeAreas interface

複数のワークシート内の 1 つまたは複数の四角形の範囲のコレクションを表します。

注釈

/**
 * This script finds the direct precedents of the active cell.
 * It changes the font and color of those precedent cells. 
 */
function main(workbook: ExcelScript.Workbook) {
  // Get the active cell.
  const selected = workbook.getActiveCell();
  
  // Get the cells that are direct precedents of the current cell.
  const precedents : ExcelScript.WorkbookRangeAreas = selected.getDirectPrecedents();

  // Set the font to bold and the fill color to orange for all the precedent cells.
  precedents.getRanges().forEach(range => {
    range.getFormat().getFill().setColor("orange");
    range.getFormat().getFont().setBold(true);
  });
}

メソッド

getAddresses()

A1 スタイルのアドレスの配列を返します。 アドレス値には、セルの四角形の各ブロックのワークシート名が含まれます (例: "Sheet1!A1:B4、Sheet1!D1:D4")。 読み取り専用です。

getAreas()

オブジェクトを RangeAreasCollection 返します。 コレクション内のそれぞれ RangeAreas は、1 つのワークシート内の 1 つまたは複数の四角形の範囲を表します。

getRangeAreasBySheet(key)

コレクション内の RangeAreas ワークシート名または ID に基づいてオブジェクトを返します。 ワークシートが存在しない場合、このメソッドは を返します undefined

getRanges()

オブジェクト内でこのオブジェクトを構成する範囲を RangeCollection 返します。

メソッドの詳細

getAddresses()

A1 スタイルのアドレスの配列を返します。 アドレス値には、セルの四角形の各ブロックのワークシート名が含まれます (例: "Sheet1!A1:B4、Sheet1!D1:D4")。 読み取り専用です。

getAddresses(): string[];

戻り値

string[]

getAreas()

オブジェクトを RangeAreasCollection 返します。 コレクション内のそれぞれ RangeAreas は、1 つのワークシート内の 1 つまたは複数の四角形の範囲を表します。

getAreas(): RangeAreas[];

戻り値

getRangeAreasBySheet(key)

コレクション内の RangeAreas ワークシート名または ID に基づいてオブジェクトを返します。 ワークシートが存在しない場合、このメソッドは を返します undefined

getRangeAreasBySheet(key: string): RangeAreas;

パラメーター

key

string

ワークシートの名前または ID。

戻り値

getRanges()

オブジェクト内でこのオブジェクトを構成する範囲を RangeCollection 返します。

getRanges(): Range[];

戻り値