Skip to content

Latest commit

 

History

History

split-sheets-by-column

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Split Sheets by Column

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.

Reference

splitSheetsByColumn(sheets, baseColToSplit, folderID)

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

View input sheets

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);

View output files