ExcelScript.SortBy enum

並べ替えの方向を表します。

注釈

使用元

/**
* This script shows how to use setAutoSortOnCell to automatically sort
* a PivotTable's row labels based on values in a specific data column.
*/
function main(workbook: ExcelScript.Workbook) {
  // Get the "Farm Pivot" PivotTable.
  const pivotTable = workbook.getPivotTable("Farm Pivot");
  const sheet = pivotTable.getWorksheet();

  // Get the PivotTable's layout object.
  const layout = pivotTable.getLayout();

  // Pick a cell in the PivotTable's data area to sort by.
  const sortCell1 = sheet.getRange("N6");
  layout.setAutoSortOnCell(sortCell1, ExcelScript.SortBy.descending);
}

フィールド

ascending

昇順並べ替え。 最小から最大値、または A から Z。

descending

降順の並べ替え。 最大から最小、または Z から A。