ExcelScript.RangeView interface

RangeView は、親の範囲の表示されているセルのセットを表します。

注釈

/**
 * This script copies values and formatting from the 
 * visible range of a table in Sheet1 into Sheet2.
 */
function main(workbook: ExcelScript.Workbook) {
  // Get the filtered data from Sheet1.
  const currentSheet = workbook.getWorksheet("Sheet1");
  const table = currentSheet.getTables()[0];
  const visibleTableRange: ExcelScript.RangeView = table.getRange().getVisibleView();
  const source = currentSheet.getRanges(visibleTableRange.getCellAddresses().toString());

  // Copy the data into the other sheet.
  const otherSheet = workbook.getWorksheet("Sheet2");
  const otherRangeCorner = otherSheet.getRange("A1");
  otherRangeCorner.copyFrom(source, ExcelScript.RangeCopyType.all);
}

メソッド

getCellAddresses()

のセル アドレスを RangeView表します。

getColumnCount()

表示される列の数。

getFormulas()

A1 スタイル表記の数式を表します。 セルに数式がない場合は、代わりに値が返されます。

getFormulasLocal()

ユーザーの言語と数値書式ロケールで、A1 スタイル表記の数式を表します。 たとえば、英語の数式 "=SUM(A1, 1.5)" は、ドイツ語では "=SUMME(A1; 1,5)" になります。 セルに数式がない場合は、代わりに値が返されます。

getFormulasR1C1()

R1C1 スタイル表記の数式を表します。 セルに数式がない場合は、代わりに値が返されます。

getIndex()

のインデックスを表す値を RangeView返します。

getNumberFormat()

指定したセルの Excel の数値書式コードを表します。

getRange()

現在 RangeViewの に関連付けられている親範囲を取得します。

getRowCount()

表示される行の数。

getRows()

範囲に関連付けられている範囲ビューのコレクションを表します。

getText()

指定した範囲のテキスト値。 テキスト値は、セルの幅には依存しません。 Excel UI で発生する # 記号による置換は、この API から返されるテキスト値には影響しません。

getValues()

指定した範囲ビューの Raw 値を表します。 返されるデータの型は、文字列、数値、ブール値のいずれかになります。 エラーが含まれているセルは、エラー文字列を返します。

getValueTypes()

各セルのデータの種類を表します。

setFormulas(formulas)

A1 スタイル表記の数式を表します。 セルに数式がない場合は、代わりに値が返されます。

setFormulasLocal(formulasLocal)

ユーザーの言語と数値書式ロケールで、A1 スタイル表記の数式を表します。 たとえば、英語の数式 "=SUM(A1, 1.5)" は、ドイツ語では "=SUMME(A1; 1,5)" になります。 セルに数式がない場合は、代わりに値が返されます。

setFormulasR1C1(formulasR1C1)

R1C1 スタイル表記の数式を表します。 セルに数式がない場合は、代わりに値が返されます。

setNumberFormat(numberFormat)

指定したセルの Excel の数値書式コードを表します。

setValues(values)

指定した範囲ビューの Raw 値を表します。 返されるデータの型は、文字列、数値、ブール値のいずれかになります。 エラーが含まれているセルは、エラー文字列を返します。

メソッドの詳細

getCellAddresses()

のセル アドレスを RangeView表します。

getCellAddresses(): string[][];

戻り値

string[][]

/**
 * This script copies values and formatting from the 
 * visible range of a table in Sheet1 into Sheet2.
 */
function main(workbook: ExcelScript.Workbook) {
  // Get the filtered data from Sheet1.
  const currentSheet = workbook.getWorksheet("Sheet1");
  const table = currentSheet.getTables()[0];
  const visibleTableRange: ExcelScript.RangeView = table.getRange().getVisibleView();
  const source = currentSheet.getRanges(visibleTableRange.getCellAddresses().toString());

  // Copy the data into the other sheet.
  const otherSheet = workbook.getWorksheet("Sheet2");
  const otherRangeCorner = otherSheet.getRange("A1");
  otherRangeCorner.copyFrom(source, ExcelScript.RangeCopyType.all);
}

getColumnCount()

表示される列の数。

getColumnCount(): number;

戻り値

number

getFormulas()

A1 スタイル表記の数式を表します。 セルに数式がない場合は、代わりに値が返されます。

getFormulas(): string[][];

戻り値

string[][]

getFormulasLocal()

ユーザーの言語と数値書式ロケールで、A1 スタイル表記の数式を表します。 たとえば、英語の数式 "=SUM(A1, 1.5)" は、ドイツ語では "=SUMME(A1; 1,5)" になります。 セルに数式がない場合は、代わりに値が返されます。

getFormulasLocal(): string[][];

戻り値

string[][]

getFormulasR1C1()

R1C1 スタイル表記の数式を表します。 セルに数式がない場合は、代わりに値が返されます。

getFormulasR1C1(): string[][];

戻り値

string[][]

getIndex()

のインデックスを表す値を RangeView返します。

getIndex(): number;

戻り値

number

getNumberFormat()

指定したセルの Excel の数値書式コードを表します。

getNumberFormat(): string[][];

戻り値

string[][]

getRange()

現在 RangeViewの に関連付けられている親範囲を取得します。

getRange(): Range;

戻り値

getRowCount()

表示される行の数。

getRowCount(): number;

戻り値

number

getRows()

範囲に関連付けられている範囲ビューのコレクションを表します。

getRows(): RangeView[];

戻り値

getText()

指定した範囲のテキスト値。 テキスト値は、セルの幅には依存しません。 Excel UI で発生する # 記号による置換は、この API から返されるテキスト値には影響しません。

getText(): string[][];

戻り値

string[][]

getValues()

指定した範囲ビューの Raw 値を表します。 返されるデータの型は、文字列、数値、ブール値のいずれかになります。 エラーが含まれているセルは、エラー文字列を返します。

getValues(): (string | number | boolean)[][];

戻り値

(string | number | boolean)[][]

getValueTypes()

各セルのデータの種類を表します。

getValueTypes(): RangeValueType[][];

戻り値

setFormulas(formulas)

A1 スタイル表記の数式を表します。 セルに数式がない場合は、代わりに値が返されます。

setFormulas(formulas: string[][]): void;

パラメーター

formulas

string[][]

戻り値

void

setFormulasLocal(formulasLocal)

ユーザーの言語と数値書式ロケールで、A1 スタイル表記の数式を表します。 たとえば、英語の数式 "=SUM(A1, 1.5)" は、ドイツ語では "=SUMME(A1; 1,5)" になります。 セルに数式がない場合は、代わりに値が返されます。

setFormulasLocal(formulasLocal: string[][]): void;

パラメーター

formulasLocal

string[][]

戻り値

void

setFormulasR1C1(formulasR1C1)

R1C1 スタイル表記の数式を表します。 セルに数式がない場合は、代わりに値が返されます。

setFormulasR1C1(formulasR1C1: string[][]): void;

パラメーター

formulasR1C1

string[][]

戻り値

void

setNumberFormat(numberFormat)

指定したセルの Excel の数値書式コードを表します。

setNumberFormat(numberFormat: string[][]): void;

パラメーター

numberFormat

string[][]

戻り値

void

setValues(values)

指定した範囲ビューの Raw 値を表します。 返されるデータの型は、文字列、数値、ブール値のいずれかになります。 エラーが含まれているセルは、エラー文字列を返します。

setValues(values: (string | number | boolean)[][]): void;

パラメーター

values

(string | number | boolean)[][]

戻り値

void