Split sheets based on column content. You can pass one or more sheets to the method, it will keep correspondingly content names on the same file.
Parameter | Type | Optional | Default | Description |
---|---|---|---|---|
sheets | Array<Sheet> | ❌ | Sheets to split. | |
baseColToSplit | number | ✔️ | 1 | The column to split, based on content; column indexing starts with 1. |
folderID | string | ✔️ | none | The ID of the folder it should save the files. Will use config.folder if set, or else it will create one with the same name as the main spreadsheet. |
Returns: Array<Spreadsheet>
Examples
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
const nato = spreadsheet.getSheetByName('NATO');
const numbers = spreadsheet.getSheetByName('Numbers');
/* Split both sheets based on first column */
SplitSheetbyColumn.splitSheetByColumn([nato, numbers], 1);